so I'm interested in knowing if there's a way through javascript, php whatever to be able to read the pages current URL. For example when the page loads and knows the difference between www.mySite.com/ and www.mySite.com/#about
I'm trying to find if there's a way to use the '#about' as a variable for a particular script instead of just it being dummy text on the end of the URL.
05-03-2011, 09:44 PM
interfacetricks
You can use the document.URL property to read the entire url. Then you can use whatever string or regular-expression routines are appropriate to extract the part you want.
Here is a basic example of reading two variables out of the URL.