diff --git a/docs/developing/troubleshooting.md b/docs/developing/troubleshooting.md index b5b71bee..a2716568 100644 --- a/docs/developing/troubleshooting.md +++ b/docs/developing/troubleshooting.md @@ -22,7 +22,7 @@ docs about the `vagrant-spk enter-grain` command](debugging.md). ## Clicking a link in the app does not open the link Sandstorm apps cannot navigate the user away from the app. Therefore, app -authors should set `target="_blank"` on links within the app. +authors should set `target="_blank"` on external links within the app. A convenient way to do this automatically for all links in the page is to add the following HTML to your document's ``: @@ -31,6 +31,20 @@ the following HTML to your document's ``: ``` +However, if you have both internal and external links, you can add a script +such as the following which will only set the target on external links: + +```js +window.onload = function(){ + var a = document.getElementsByTagName('a'); + for (var i=0; i