R8VI
asked on
get url parameter value in javascript
HI,
I have a URL which has the parameter "ID"
how can i get the value of the ID in javascript
please help
Thanks
R8VI
I have a URL which has the parameter "ID"
how can i get the value of the ID in javascript
please help
Thanks
R8VI
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wherever you're looking to use the ID value, such like this:
var idParam = QueryString.id;
ASKER
I am sorry could you please explain a bit further
Ultimately what are you trying to accomplish with the url perameter?
Try:
var id = document.getElementById("U RL").getAt tribute("i d");
var id = document.getElementById("U
doesn't work in Chrome...
ASKER
Hi,
So I have a URL like so
http://localhost:49768/Solution/IframePage.aspx?Name=Ellis&URL=http://www.test.com
I would like to get the Value of "URL" which in this case would be http://www.test.com
and store it in a variable
Thanks
R8VI
So I have a URL like so
http://localhost:49768/Solution/IframePage.aspx?Name=Ellis&URL=http://www.test.com
I would like to get the Value of "URL" which in this case would be http://www.test.com
and store it in a variable
Thanks
R8VI
ok, so using my example above, just create a variable:
var myURL;
then assign it like:
myURL = QueryString.URL;
the function I gave earlier runs upon page load, and it basically creates an "object" with properties that are the url parameters
var myURL;
then assign it like:
myURL = QueryString.URL;
the function I gave earlier runs upon page load, and it basically creates an "object" with properties that are the url parameters
You could also toggle the string with JS string functions (see http://w3schools.com/js/js_obj_string.asp) and extract the URL.
ASKER
Thanks for this but where do I substitute the ID in your code
R8vi