By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,931 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,931 IT Pros & Developers. It's quick & easy.

issue on onload() event

P: 3
hi..,
i have a strange requirement over here.., i need to set a <div> hidden when a page is loaded for the first time and i need to put the <div> visible when the page is reloaded (i mean after the first time on wards..).

Iam setting the <div> visibility properties using window.onload() event..,so when the page is first loaded using onload function it will set the <div> invisible, and later i need the <div> to be visible when i reload the page..,how can i do that?

so how to identify the scenario of whether the page is loaded for the first time or loaded for more then one time..

Suggestions appreciated.,thanx.
Jan 23 '08 #1
Share this Question
Share on Google+
2 Replies


P: 3
hi..,
i have a strange requirement over here.., i need to set a <div> hidden when a page is loaded for the first time and i need to put the <div> visible when the page is reloaded (i mean after the first time on wards..).

Iam setting the <div> visibility properties using window.onload() event..,so when the page is first loaded using onload function it will set the <div> invisible, and later i need the <div> to be visible when i reload the page..,how can i do that?

so how to identify the scenario of whether the page is loaded for the first time or loaded for more then one time..

Suggestions appreciated.,thanx.
indirectly it means identifying that the page has been loaded for the 2nd time..,so checkin that condition we can set the <div> visibility accordingly..,but how to identify whether the page has been loaded for the first time? or else reloaded?
Jan 24 '08 #2

gits
Expert Mod 5K+
P: 5,329
hi ...

onload of you page you may set/read a cookie to achieve that ...

in case the cookie is set already the user had to have the page loaded once :) another way would be to store a flag for that issue at the serverside.

kind regards
Jan 24 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.