The code is as follows: Give it a try!
<script> <br>String.prototype.getQuery = function(name) <br>{ <br> var reg = new RegExp("(^|&)" name "=([^&]*)(&|$)"); <br> var r = this.substr(this.indexOf( "?") 1).match(reg); <br> if (r!=null) return unescape(r[2]); return null; <br>} <br>var str ="www.abc.com /index.htm?a=1&b=1&c=test test"; <br>alert(str.getQuery("a")); <br>alert(str.getQuery("b")); <br>alert( str.getQuery("c")); <br></script>