JavaScript Query String Extraction
When the JavaScript on a web page needs to know about any query string that came with the page request, this one-liner will grab it. (A query string is the data/parameters following a "?" of a link URL.)
var query_string = unescape(location.search.substr(1));
The above will store the query string in variable query_string. If no query string came with the page request, variable query_string will be blank.
This JavaScript can be used to test it.
<script type="text/javascript"><!-- var query_string = unescape(location.search.substr(1)); alert(query_string); //--></script>
To test, put the JavaScript into a web page (assuming mypage.html page name) and load it with a URL like http://example.com/mypage.html?me=yes (or parameter other than the me=yes example). An alert box will tell you what query information it received, if any.
Will Bontrager