Possible Duplicate:
obtaining querystring from current url in javascript?
I was to get everything after the question mark in the url. Ive seen a way to do it that does not require a function but cannot find it for the life of me.
url
fsdhfbsdfj/index.html?hello
get
hello
Use
var query = window.location.search;
If you want to get rid of the starting "?", use
var query = window.location.search.slice(1);
The properties of the location object are described here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With