Hi,
We can make use of the following functions to get the value of querystring parameters through JavaScript
// helper function to get the query string
function Querystring() {
var querystring = location.search.substring(1, location.search.length);
var args = querystring.split(‘&’);
for (var i = 0; i < args.length; i++) {
var pair = args[i].split(‘=’);
temp = unescape(pair[0]).split(‘+’);
name = temp.join(‘ ‘);
temp = unescape(pair[1]).split(‘+’);
value = temp.join(‘ ‘);
this[name] = value;
}
this.get = Querystring_get;
}
function Querystring_get(strKey, strDefault) {
var value = this[strKey];
if (value == null) {
value = strDefault;
}
return value;
}
Suppose our current page url is
http://mycustompage/home.aspx?id=1020
To get the value for id we’ll do this
var qs = new Querystring();
Bye..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

Hi admin i see you don’t earn on your blog. You can earn extra
bucks easily, search on youtube for: how to earn selling articles
LikeLike