Skip to content

Instantly share code, notes, and snippets.


edm00se/betterWay.js Secret

Last active Mar 30, 2021
What would you like to do?
for the "signs of an advancing web" blog post
const parm = new URLSearchParams(;
console.log(parm.get('foo')); // 'bar'
function getQueryParam(searchKey){
var qs = window.location.split('?')[1];
var parmAr = qs.split('&');
var parm = {};
for(i = 0; i<parmAr.length; i++) {
var cur = parmAr[i].split('=');
var key = cur[0];
var val = cur[1];
parm[key] = val;
return parm[searchKey];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment