Are you serious? Javascript doesn't have a way of grabbing it without parsing?
Main Topics
Browse All TopicsJavascript Querystring Question -
URL: www.test.com/heya.htm?quer
In the above url how can I put javascript in heya.htm to get the value of query?
For example,
<script language="javascript>
var theQuery = request.querystring("query
alert theQuery
</script>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes and No. Javascript makes you work for it. You can do another split to create an array of each name/value pair. Then you will need to split each item in that array to get the value. Does the name matter at all or just the value in the query? In other words would you want to know "query" or just "hello" using your example above?
bol
This is why I never (or almost never) use Javascript to read the querystring. Is ASP or another server script just not an option? Beside requiring more work you depend on the browser to do it all. The script might be disabled or not supported and then that part of the page won't work. I usually find it better (and easier) to let the server do it.
I hope this helps but let me know if you have a question about it.
bol
Business Accounts
Answer for Membership
by: b0lsc0ttPosted on 2007-06-20 at 14:03:53ID: 19328244
If there is just one name/value pair in the query you can use script like this ...
>
<script language="text/javascript"
var url = window.location;
var query = url.split("?")[1];
var value1 = query.split("=")[1];
alert(value1);
</script>
Let me know if you have a question or need more info.
bol