Javascript window.open() passing args

后端 未结 1 1634
情歌与酒
情歌与酒 2020-12-22 05:09

I am trying to use window.open() to pass along some arguments to another page.

I want the page to be

myPage.html?img=1.jpg
1条回答
  •  离开以前
    2020-12-22 05:38

    myPage.html should exist, and check the docs on window.open

    to pass vars:

    var variable = "lol";
    var w = window.open("http://example.com");
    w.variable = variable;
    

    or yopu can visit the opeing window:

    var variable = window.opener.variable;
    

    0 讨论(0)
提交回复
热议问题