//获取URL function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { vars[key] = value; } ); return vars; } //例子 getUrlVars()[‘name‘]
原文:https://www.cnblogs.com/llcdbk/p/15169589.html