页面跳页面的参数获取

第一个页面跳转传参

window.location.href='aa.html?id='+id

第二个页面获取参数id

split()把字符串变成数组

window.location.href.split('=')[1]

a标签传汉字

window.location.href='aa.html?id='+encodeURI(id)

接收汉字

var content=decodeURI(location.href.split('=')[1])

 

    1. 第一个页面(a.html):
    2. var obj = a.value; //传给弹出页面参数
    3. var url = 'jxb.html?obj='+obj;
    4. url = encodeURI(url);
    5. window.open(url, "", "width=600,height=400");
    6. 第二个页面(b.html):
    7. var url = decodeURI(window.location.href);
    8. var argsIndex = url .split("?obj=");
    9. var arg = argsIndex[1];
posted @ 2018-07-23 18:02  看看时间  阅读(279)  评论(0编辑  收藏  举报