I have made a class in javascript with an object that contains both variables and functions. I instantiate the object within one .html page, but when I change to another .html page, the object seems to be 'empty'. How can I pass the object between one page to another?
相关问题
- Is there a limit to how many levels you can nest i
- how to define constructor for Python's new Nam
- How to toggle on Order in ReactJS
- void before promise syntax
- Do the Java Integer and Double objects have unnece
You can have a look at Web Storage. This won't allow you to store a full JavaScript object, however you will be able to store as many string name-value pairs as you want. Either permanently (between browser restarts) or as part of a session.
Use localStorage, check this lib: https://github.com/marcuswestin/store.js
You can do something like:
and then...
Removing stored objects:
Fork "jQuery-like" syntax: http://pastebin.com/x3KpKyr1