How to pass javascript object from one page to other

前端 未结 7 1623
时光说笑
时光说笑 2020-11-27 07:27

I want to pass javascript object from one page to other page so anyone can tell me how to do it?

Is that possible to do so using jQuery?

7条回答
  •  渐次进展
    2020-11-27 07:43

    This is possible to do, and you have a couple of options.

    Local Storage

    Can be added/eddited/removed at any stage and accessed across a domain. (doesn't work natively in ie6 and ie7 however there are work arounds for that)

    The Window Object

    I would put a massive cavet around this not being the best solution, it's not at all secure, so only use it for things that don't need to be kept private. window.name = { "json" : "object"} which is then available in the following page in the window.name property.

提交回复
热议问题