Hi guys I’ve developed a google maps application witha neat search feature – however I’ve noticed that I would like to have something like what the facebook guys have done as in having a hardlink to a page that is generated by an ajax query. Example you click on a link in facebook and it appends to the current url and you can copy paste the new url to get the requested page … how do I implement something like that…
Hi guys I’ve developed a google maps application witha neat search feature – however
Share
You can use the
location.hash(the part of the URL after the #) to set “hard links” from withing JavaScript. This does not cause the page to reload, like changing thelocation.hrefdoes, but you can fetch the value and use it in JavaScript.Consider this example:
When you click on one of the page links, the
location.hashis changed, the URL of the browser is updated and the value used in the page is changed. If the user then copies the URL directly from the address bar, or bookmarks it, the selected page will be reloaded when the URL is requested again.