Created
March 4, 2015 08:07
-
-
Save mtmzorro/b0ce27c9a0d8de0bf9f3 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
function getQueryString(name) { | |
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | |
var r = window.location.search.substr(1).match(reg); | |
if (r != null) return unescape(r[2]); return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment