Let's not change the a
element's href
to a hashed url as suggested by others, as it could disrupt the user experience. This would result in double loading for those wanting to open in new window, and cause issues for search engines and users with Javascript disabled.
The problem arises when using hashes to transition your website into a RIA (rich internet application), where links point to mysite.com/page
but actually access mysite.com/#/page
, leading to inconsistencies in visiting the original page.
A better solution is to utilize the HTML5 History API, allowing direct URL changes and enabling tracking of URL changes without the use of hashes. For more information on the comparison between hashes, hashbangs, and HTML5 History API, check out this link: https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling, which also provides sample code for upgrading your website with the HTML5 History API.
jQuery Mobile is set to adopt the HTML5 History API in the future (currently in progress), so it may be worth waiting until this implementation is complete.