Skip to content

Instantly share code, notes, and snippets.

@chicagoworks
Created December 25, 2010 16:00

Revisions

  1. @cklanac cklanac created this gist Dec 25, 2010.
    8 changes: 8 additions & 0 deletions window.location.query
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    (function() {
    var arr = decodeURIComponent(window.location.search.substr(1)).replace(/\+/g," ").split('&'), p;
    window.location.query = {};
    for (var i = 0; i < arr.length; i++) {
    p = arr[i].split('=');
    window.location.query[p[0]] = p[1];
    }
    })();