skaterdav85 Posted August 12, 2011 Share Posted August 12, 2011 im sure some of you have seen on facebook, that when you go through photos, it changes the URL, but no page refresh is being made. anyone have an idea as to how you do that? Link to comment Share on other sites More sharing options...
Drycodez Posted August 12, 2011 Share Posted August 12, 2011 function changeurl(){location.hash="domaing.com"} CALL IT <a href="java script:void(0)" onmouseover="changeurl()">change url</a> Link to comment Share on other sites More sharing options...
skaterdav85 Posted August 12, 2011 Author Share Posted August 12, 2011 does this work in all browsers? Link to comment Share on other sites More sharing options...
thescientist Posted August 12, 2011 Share Posted August 12, 2011 function changeurl(){location.hash="domaing.com"} CALL IT <a href="java script:void(0)" onmouseover="changeurl()">change url</a> doesn't hash only return part of a URL after a #? It doesn't write anything.http://www.w3schools.com/jsref/prop_loc_hash.asp Link to comment Share on other sites More sharing options...
justsomeguy Posted August 12, 2011 Share Posted August 12, 2011 It's a writable property, at least in Firefox. Link to comment Share on other sites More sharing options...
thescientist Posted August 12, 2011 Share Posted August 12, 2011 It's a writable property, at least in Firefox.yeah, good call. should have referred to MDN first.https://developer.mozilla.org/En/Window.location#Propertiesalthough it's worth nothing that the browser support table at the bottom of the page leaves something to be desired. Link to comment Share on other sites More sharing options...
skaterdav85 Posted August 12, 2011 Author Share Posted August 12, 2011 thanks guys! Link to comment Share on other sites More sharing options...
skaterdav85 Posted August 13, 2011 Author Share Posted August 13, 2011 is it possible to change the URL without a page refresh and also without using a hash (#) ? Apparently the browser doesnt pass anything after a hash to the server, so you cant access the hash value in your php script. Basically im using the hash to change the URL in a page that's using ajax, and I want the user to be able to copy the URL and send it to someone else and have the same content displayed. However, without having access to the hash in PHP, I cant do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.