Pass a variable to new page

前端 未结 1 1444

I am trying to pass a variable from one page, load another and enter that information. something Like this:

When 127.0.0.1/test.html&ID=1234

location         


        
相关标签:
1条回答
  • 2021-01-29 05:14

    You could pass the values on the query string and then read those:

    location.href = "http://127.0.0.1/newpage.html?foo=1&bar=2";
    

    Then use location.search to get the query string and parse it with Javascript. Just make sure none of the query string terms collide with any others that may exist.

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