PDA

View Full Version : Display URL data



DigitalBard
08-02-2007, 06:22 PM
I want to run the following simple URL:

simple.html?Something

I want the page to display:

URL data = Something

I know this is simple stuff, but I'm a relative JavaScript novice and I haven't been able to figure out how to get info from the URL.

Thanks!

Twey
08-02-2007, 06:46 PM
document.body.createElement("p").appendChild(document.createTextNode("URL data = " + location.href.substr(location.href.indexOf("?") + 1)));

DigitalBard
08-02-2007, 10:42 PM
Thank you so very much, that did the trick!!