...

View Full Version : Alert Box Help



Haz567
06-04-2006, 11:30 AM
Okay i'm building a CD-ROM navigation system.

Upon opening the Index.html file, i have a javascript alert in place telling the best resolution to run the CD-ROM at which pops up.

This is fine, and everytime i click on 'Home' in my navigation bar it reopens Index.html which i want it to do. However the javascript alert also loads which is a nuiscance. Does anybody know how to get it to run only once?

The code is the basic script so far -

<script type="text/javascript"> alert("This CD-ROM is best viewed at a resolution of 1280 x 1024 pixels");</script>

I am using a frameset and i have placed the alert in the main content window, as it wouldn't work when i placed it in the actual frameset file. Could this have something to do with it?

Thanks.

A1ien51
06-04-2006, 01:09 PM
look into cookies

Eric

Haz567
06-04-2006, 11:18 PM
I don't quite understand sorry.

_Aerospace_Eng_
06-04-2006, 11:21 PM
You need to set a cookie on the users system that tells the script its been ran once. Look into reading and writing javascript cookies.

Haz567
06-05-2006, 11:40 AM
Okay.. that sounds like a good idea. However i wish for it to happen everytime the CD-ROM is booted. Is that possible?

_Aerospace_Eng_
06-05-2006, 07:39 PM
You can probably use onunload to delete the cookie so it gets deleted when the browser is exit.

onunload = functiontodeletecookie;
or even onbeforeunload which I think is IE only.

onbeforeunload = functiontodeletecookie;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum