Jump to content

changing the URL without a page refresh


skaterdav85

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.
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...