Link to home
Start Free TrialLog in
Avatar of mattturley
mattturley

asked on

JavaScript Run Once

I need to run the following code one time only.  If a user comes back to the page containing the code, it should not run again.  I have been looking at using cookies, but am not sure of the exact implementation.

goSub("/user/site/browseCatalog.do","menu1","top");

Thoughts on best approach?  Ideally the cookie (or other means) would expire when the user exits their browser.
Avatar of Beholdason
Beholdason
Flag of United Kingdom of Great Britain and Northern Ireland image

What you'll need to use is a session cookie and before excuting "goSub("/user/site/browseCatalog.do","menu1","top");" check if the session cookie exists.
ASKER CERTIFIED SOLUTION
Avatar of quincydude
quincydude
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mattturley
mattturley

ASKER

worked.