Very simple JS request all url vars
Very simple request all vars from url. Easy to understand.
function requestUrlVars(){
var params = window.location.search
if (params){
var url_params = params.replace('?','').split('&');
var requests = {};
for(var i in url_params){
var key = url_params[i].split('=');
requests[key[0]] = key[1];
}
return requests;
}else{
return false;
};
};
Written by Arthur
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#