I’ve been working on creating a pop up for a candy fundraising website, and have come across one JavaScript code question that’s been really bugging me.
The code is as follows (in the <head>):
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(“page” + id + ” = window.open(URL, ‘” + id + “‘, ‘toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300,left = 690,top = 190’);”);
}
// End –>
</script>
Is there any code that I’m missing that would tell the pop-up to load only the first time a user opens the site? Every time the main frame is opened, the pop-up (of course) pops up. However, it’s distracting to have it open every single time a user refreshes, etc. How would I go about having this pop-up only open once for a user?
Thank you for any help you can give me! It’s much appreciated.