Jump to content

changing the URL without a page refresh


skaterdav85
 Share

Recommended Posts

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

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. Edited by thescientist
Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...