how to pass values from one page to another page in javascript

后端 未结 2 509
不思量自难忘°
不思量自难忘° 2021-01-24 00:38

Hi I have a table that was created in javascript, what I need to know is how to pass the values in row 1 or 2 into a aspx page using javascript with the click of a button: here

相关标签:
2条回答
  • 2021-01-24 00:53

    To send big amount of data you can try this:

    1. Create form with method post and action equal to url you want to redirect to (form can be hidden — it is not problem)
    2. Create textarea/text field (not neccessary) in this form
    3. Put your data in this textarea
    4. Submit form via JS
    5. Receive data on new page

    Note, that javascript will escape data in this form. To unescape it use unescape() function.

    0 讨论(0)
  • 2021-01-24 01:06

    You have a few options: You could save the data in a cookie for re-use later, you could pass the data to the next page as a series of GET variables, or you could load the next page using AJAX so that your variables remain available.

    Since you're using ASP, you could do something like this:

    function Redirect() {
        window.open ("http://10.19.13.67/ReworkLabels/Default.aspx?myVariable=" + myVariable,"my window");
        return false;
    }
    
    0 讨论(0)
提交回复
热议问题