Html页面跳转传参,中文乱码解决

encodeURL编码 decodeURL解码
第一个页面

var searchUrl=encodeURI('index2.html?name=' + name + '&danwei=' + danwei)
window.location.href = searchUrl;

第二个页面

var url = decodeURI(window.location.href.split('?')[1]);

猜你喜欢

转载自blog.csdn.net/weixin_42442123/article/details/86504088