Created
February 4, 2014 06:51
-
-
Save arbaaz/8799175 to your computer and use it in GitHub Desktop.
get_url_params_jquery.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUrlParams() { | |
var paramMap = {}; | |
if (location.search.length == 0) { | |
return paramMap; | |
} | |
var parts = location.search.substring(1).split("&"); | |
for (var i = 0; i < parts.length; i ++) { | |
var component = parts[i].split("="); | |
paramMap [decodeURIComponent(component[0])] = decodeURIComponent(component[1]); | |
} | |
return paramMap; | |
} | |
var params = getUrlParams(); | |
console.log(location.search); | |
v1=params.document; | |
console.log(v1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment