Quote:
Originally Posted by snow
I don't think there's a way to do it between pages with JavaScript - that I can remember anyway... I think you'd need some kind of session.
On the same page, to make it pop up only once you could do something like...
- Code: Select all
function pop() {
if (done!=1) {
alert("hey you! eggburger! farts!");
done=1;
}
}
Just off the top of my head after I haven't used it for a while - so there are probably much better solutions out there!
|
Be aware of a problem here that often catches out people new to JavaScript and other similar languages for that matter.
The variable you are setting, 'done' only exists inside the function, so once the function finishes, so the variable 'done' no longer exists. You would need to define the variable globally.