摘要:
老是遇到这个需求,还是记录一下,以后直接copy吧。function getParam(url, name){ var reg = new RegExp("(^|\\?|&|#)"+ name +"=([^&]*)(&|$)", "i"); var oMatch = url.match(reg); var result = ""; if(oMatch){ result = decodeURIComponent(oMatch[2]); } return result; } 阅读全文