Persist javascript variables between GET requests?

后端 未结 4 501
-上瘾入骨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 09:58

    If the objects you're storing are big, or if you want to restore them precisely (which JSON certainly doesn't) then use http://rhaboo.org. Most libraries serialise large objects and arrays into a single localStorage entry, but that means decoding and re-encoding the whole thing at every little change, which means gradually worsening performance for loyal users. Rhaboo uses a separate LS entry for each terminal value in the object, and then adjusts or appends them individually, so you don't get that performance hit.

    BTW, I wrote rhaboo.

提交回复
热议问题