Skip to content

Instantly share code, notes, and snippets.

@flowerains
Created September 9, 2013 02:32
Show Gist options
  • Save flowerains/6490836 to your computer and use it in GitHub Desktop.
Save flowerains/6490836 to your computer and use it in GitHub Desktop.
jquery获取页面url的值
//获取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