Created
September 9, 2013 02:32
-
-
Save flowerains/6490836 to your computer and use it in GitHub Desktop.
jquery获取页面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
//获取get的值 | |
function getUrlArgs(_name,url){ | |
var url = window.location.href; | |
if(new RegExp(".+"+_name+"=([^&]+).*","gi").test(url)){ | |
return RegExp.$1; | |
}else{ | |
return ""; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment