Skip to content

Instantly share code, notes, and snippets.

@maxterry
Created January 27, 2012 17:01
Show Gist options
  • Select an option

  • Save maxterry/1689788 to your computer and use it in GitHub Desktop.

Select an option

Save maxterry/1689788 to your computer and use it in GitHub Desktop.

Revisions

  1. maxterry created this gist Jan 27, 2012.
    13 changes: 13 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    function param(key) {
    var params = {}
    window.location.search.substr(1).split("&").forEach(function(it) {
    var slots = it.split("=")
    params[slots[0]] = slots[1] == "true"? true :
    slots[1] == "false"? false :
    slots[1]
    })
    param = function(key) {
    return params[key]
    }
    return param(key)
    }