Grab URL variables
Requests = {
QueryString : function(item){
var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
return svalue ? svalue[1] : svalue;
}
}
//usage
Requests.QueryString("id");
// Sourced from http://css-tricks.com/snippets/javascript/get-url-variables/