posted 17 years ago
I wonder. Suppose I have two html files written in HTML and JavaScript (which I wrote), called page1.html and page2.html. All the variables belonging to page1.html will be referred to, as long as page1 is being displayed, as document.variable1, document.variable2, etc., right? The "document." part can be dropped, and the variables can also be referred to as variable1, variable2, etc. right?
Now, suppose I have page1 loaded, and the variables are all set to some value determined by the user input. Then the user clicks on a link and page2 is loaded. But suppose I want the browser to remember the values of the variables in page1. Does the browser forget the page1 variables? If not, how should I refer to the page1 variables? How is this usually done? Do you go to page2 and then refer to page1 variables? Or do you set page2 variables based on the page1 values when loading page2 and forget page1 variables?