Skip to content

Instantly share code, notes, and snippets.

@hao-ji-xing
Forked from lunaroja/jquery.getParam.js
Created December 30, 2013 15:26
Show Gist options
  • Save hao-ji-xing/8183419 to your computer and use it in GitHub Desktop.
Save hao-ji-xing/8183419 to your computer and use it in GitHub Desktop.
jQuery.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, ' '));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment