I've noticed a couple sites that if I create multiple links that share the same target, the site doesn't actually reload the request, rather it captures the link and handles it, either by loading it into a tab within its application, or changing elements within the page, again... all without reloading the URL request completely.
How do I detect this within my page?
For example, I want to to handle multiple links coming in from external links like this
<a href="http://192.168.1.10/index.php?p=1#/tag/ABC-0021" target="myapp">0021</a>
<a href="http://192.168.1.10/index.php?p=1#/tag/ABC-0031" target="myapp">0031</a>
<a href="http://192.168.1.10/index.php?p=1#/tag/ABC-0012" target="myapp">0012</a>
Right now, everytime I click one of those links, my entire app/page just refreshes in the browser tab for that target. Anyone know of a way to prevent this from happening so I can handle it appropriately?
Edit: Google Music does this - try clicking on the links, once you open a tab, move that tab to another monitor/area of your screen. Select another link, notice the content of the Google music changes, but doesn't completely refresh the entire app. https://jsfiddle.net/jonemzke/
Edit2: I imagine it has something to do with window.onbeforeunload or popstate changes, however I cannot find a specific example of code for this scenario.
Thanks guys - in my case here it was because I was actually linking to a local unsecured HTTPS server where I had no valid SSL. I was just using it for testing (and bypassing the security warning), however the browser considers this something that it needs to reload everytime. If you pass to a non HTTPS or a real HTTPS site with the hashes, it doesn't refresh like I wanted!