Read URL GET parameters

[Total: 0    Average: 0/5]

This shows how to parse a URL for any parameters that are on it via the GET method.

Body Code:

<script type=text/javascript>
var _url = "http://www.js-examples.com/?param1=value1";
document.write("_url="+_url+"<BR>");
var _l = _url.length;
document.write("_l="+_l+"<BR>");
var _x = _url.indexOf("?");
document.write("_x="+_x+"<BR>");
var _i = _url.substring(_x+1,_l);
document.write("_i="+_i+"<BR>");
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *