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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#