1.js方法,获取url传递的值
function getQueryStringRegExp(name) { var reg = new RegExp("(^|\?|&)"+ name +"=([^&]*)(\s|&|$)", "i"); if (reg.test(location.href)) return decodeURIComponent(RegExp.$2.replace(/+/g, " ")); return ""; }
2.