javascript get parameters function

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))
for (var i = 0; i < parameters.length; i++) {
var param = parameters[i].split('=');
params[param[0]] = param[1];
return params;


Popular posts from this blog

codefights smooth sailing ( CommonCharacterCount)

How to remove 8443 port in URL in tomcat