摘要: 老是遇到这个需求,还是记录一下,以后直接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; } 阅读全文
posted @ 2012-09-12 17:17 Gukw 阅读(193) 评论(0) 推荐(0) 编辑