Created
May 23, 2011 15:06
-
-
Save Victa/986844 to your computer and use it in GitHub Desktop.
Get URL parameters
This file contains 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 getUrlParameters(search) { | |
var search = search ? search : window.location.search; | |
var vars = {}; | |
if (search.length > 0) { | |
var hash, hashes = search.slice(1).split('&'); | |
for (var i = 0; i < hashes.length; i++) { | |
hash = hashes[i].split('='); | |
vars[hash[0]] = hash[1]; | |
} | |
} | |
return vars; | |
} | |
// src http://forrst.com/posts/Get_URL_parameters-DnE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version améliorée ici --> http://forrst.com/posts/Get_URL_parameters-DnE