Persist javascript variables between GET requests?

后端 未结 4 504
-上瘾入骨i
-上瘾入骨i 2021-01-22 09:31

ASP .NET is allowed
Storing the values in hidden input fields is allowed
Query String is not allowed
POST request is not allowed

It is possible to store J

4条回答
  •  不知归路
    2021-01-22 10:23

    I wouldn't highly recommend this, but the other option is to alter the window.name property.

    You can save some minor bits of data here, then retrieve them on the next page load.

    Pros:

    • Quick-n-dirty, but works

    Cons:

    • Messes up any window references for popups/child iframes
    • Since its a "hack", browser vendors may break this "feature" in the future

    Of course if you can exclude all the old browsers, then use Global/Client Session Storage!

提交回复
热议问题