url:
http://xxxx.com?name=charm&id=123
In js:
var name = getUrlParam("name");/*Get parameters in the url through regular operation*/function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return decodeURI(r[2]); return null;}The simple implementation of obtaining parameters in url through regular expressions is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.