传参数: 不让中文乱码 encodeURI()这个方法
window.open("detail?name1=" + encodeURI(filename) + "&name2=" + encodeURI(functionname))
获取参数:
var afterUrl = window.location.search.substring(1); //这是获取url后面的值
console.log(decodeURIComponent(afterUrl)) //这是中文转码 不乱码
接下来获取参数,就可以靠字符串截取,分割等方法获取了。
str.split('&') 如果你的参数含有& 这个 ,就不能用这个方法了
参考方法:substring(from,to)