usually we want to parse data from url
this is good function ~
I'm not sure because I didn't test in all cases
so that use it before fully test
function getQueryParams (url) {
var params = {};
var parameters = (url.slice(url.indexOf('?') + 1, url.length))
.split('&');
for (var i = 0; i < parameters.length; i++) {
var param = parameters[i].split('=');
params[param[0]] = param[1];
}
return params;
}
No comments:
Post a Comment