Created
May 12, 2014 03:07
-
-
Save gucheen/3aeecc7fce63ee0a37b7 to your computer and use it in GitHub Desktop.
获取url参数
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
var getQueryStringRegExp = function(name) { | |
var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i"); | |
if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment