faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 29 people (28%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How do I stop a background sound playing on a page when it is reloaded?

Apr 5th, 2008 20:05
ha mo, Colin Fraser, Mike Gadd,


The short answer is you cannot. The reason for this is actually simple,
and very obvious if you think about it. However, if you are playing
sounds using scripts then you should be knowledgable enough to try these
possible solutions : 
Like this: 
1. Set a cookie that has a short lifespan, say working on the user's
current date  for example.
2. Create a function that writes the sound code after checking the date
set on the cookie. If the two dates match, do not play the sound, if
they do not match then play the sound.  
Or this: 
1. Use 2 frames to create your page set, one permanent one not
2. Using a variable in the permanent frame as a flag to play or not play
the sound
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com