-
-
Save loadedsith/6021588 to your computer and use it in GitHub Desktop.
Jquery / Zepto agnostic plugin version of jquery.getParam() for grabbing the parameters out of the uri
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
;(function($){ | |
$.extend($, { | |
getParam: function(n,u) { | |
if(!u) var u = window.location.search; | |
var match = RegExp('[?&]' + n + '=([^&]*)').exec(u); | |
return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); | |
} | |
}) | |
})(window.Zepto || window.jQuery) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment