I am trying to open a popup that will play a bit of music, and then I want the popup to close itself after a few seconds. The popup worked fine, until I added the code that would shut the popup, using body unload settimer, as shown below. I don't want to close from the parent page, since the viewer may have moved onto another page. As coded below, the music player (midi file) starts to load, but then disappears, seemingly on the write of the body onload, leaving a blank and quiet popup (coded without the body onload settimer the popup displayed a console and played the music). The popup does close after the 5 seconds, as intended - it's just that the console doesn't stick and so the music never plays. What am I doing wrong?
G
playPop = window.open (tuneURL, "toolbar=no,location=0,directories=no,status=no,scrollbars=no,resizeable=no,copyhistory=no,width=200 ,height=30");
playPop.document.write('<Body onLoad="setTimeout(\'self.close()\',5000)">');
playPop.document.close();
G
playPop = window.open (tuneURL, "toolbar=no,location=0,directories=no,status=no,scrollbars=no,resizeable=no,copyhistory=no,width=200 ,height=30");
playPop.document.write('<Body onLoad="setTimeout(\'self.close()\',5000)">');
playPop.document.close();
Comment