How do I pass any array to a window being opened with window.open()

前端 未结 2 991
终归单人心
终归单人心 2021-01-28 22:54

I have any array called query[]

I am opening a new window with:

  window.open(\"http://localhost:8081/myapp/Query.action\",\"mywindow\",\"me         


        
2条回答
  •  旧时难觅i
    2021-01-28 23:23

    You can also pass it on the URL as well, for example:

    window.open("http://localhost:8081/myapp/Query.action?arr=" + query.join(","), "mywindow", ...
    

    This will pass it as comma separated list that can be read in the target page.

提交回复
热议问题