|
|
Q403 How do you get a page to perform something only on the initial load, and not when reloaded? Is it done with cookies?
irt.org | Knowledge Base | JavaScript | Cookie | Q403 [ previous next ] Q403 How do you get a page to perform something only on the initial load, and not when reloaded? Is it done with cookies?It can be done using cookies, although a lot of people disable cookies. Another alternative is to have a frameset with a hidden frame. You store a variable in the parent frame which says whether the main frame has already been loaded. Each time the main frames loads it checks the parent frame for the variable value to see whether it should perform the once only code:
And then in mainpage:
Feedback on 'Q403 How do you get a page to perform something only on the initial load, and not when reloaded? Is it done with cookies?' |
-- div -->
|