Showing posts with label Javascrpit - Read Query string. Show all posts
Showing posts with label Javascrpit - Read Query string. Show all posts

Wednesday, October 6, 2010

javascript to get values of query string variable:

var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}