Created
August 12, 2013 00:06
-
-
Save OliDM/6207466 to your computer and use it in GitHub Desktop.
Print out key/value pairs from querystring.
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
// querystringvalues.js | |
// https://github.com/bgrins/devtools-snippets | |
// Print out key/value pairs from querystring. | |
(function() { | |
var url = location; | |
var querystring = location.search.slice(1); | |
var tab = querystring.split("&").map(function(qs) { | |
return { "Key": qs.split("=")[0], "Value": qs.split("=")[1], "Pretty Value": decodeURIComponent(qs.split("=")[1]).replace(/\+/g," ") } | |
}); | |
console.group("Querystring Values"); | |
console.log("URL: "+url+"\nQS: "+querystring); | |
console.table(tab); | |
console.groupEnd("Querystring Values"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment