Created
May 10, 2012 02:30
-
-
Save rocktronica/2650604 to your computer and use it in GitHub Desktop.
URL Param Cleanup
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
data:text/html, <pre id="pre"></pre> <script> document.getElementById("pre").innerHTML = JSON.stringify( (function(s){ var s = (!!s.match(/\?/)) ? s.substr(s.indexOf("?")+1) : s; var qs = s.split("+").join(" "), params = {}, tokens, re = /[?&]?([^=]+)=([^&]*)/g; while (tokens = re.exec(qs)) { params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); } return params; } (prompt("?=?"))), null, 4 ); </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment