View Full Version : Play MP3 on load
03-17-2004, 11:51 PM
I need a script to play an MP3 file onloading a webpage. Right now I use bgsound in the body tag and it works fine, but what I'd like is for the file to play only once using a cookie (I have the cookie script) and then disableing the mp3 after the cookie is set. Is there a function I can use to play an MP3 file? The page is at www.rebeccaandthereplacements.com All help will be greatly appreciated.
03-18-2004, 02:14 AM
I don't really get what you're saying. Right now, it plays only once so why do you need it to work with a cookie?
03-18-2004, 04:42 AM
I want to disable the mp3 with a cookie because if the user goes to another page and then returns I don't want them to have to listen to the intro again.
03-18-2004, 03:40 PM
I've resolved my problem by using an create element function then running the function if the cookie is not present.
var sound1 = document.createElement('embed');
If anyone wants to see the entire code go to
I have a test site there. I would appreciate it if someone running Netscape could give it a test and tell me if it works. Thanks
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.