bgsound Elment

K

Kevin

Hi
I've an strange behavior, when I put the bgsound element in a page and
access to that page the session is loosed.
Does anybody knows happend that? And if are a reason for that behavior, how
can I play sound ? I need touch a button and play a sound. My code is this
( the code works ok, but the session is loosed):
Html:
....
<bgsound id="SoundContainer" src="" />
....
Javascript:...
function PlaySound()
{
document.all.SoundContainer.src = "Sounds/sound.wav";
}
....

Thanks
 
R

Ray Booysen

Kevin said:
Hi
I've an strange behavior, when I put the bgsound element in a page and
access to that page the session is loosed.
Does anybody knows happend that? And if are a reason for that behavior, how
can I play sound ? I need touch a button and play a sound. My code is this
( the code works ok, but the session is loosed):
Html:
...
<bgsound id="SoundContainer" src="" />
...
Javascript:...
function PlaySound()
{
document.all.SoundContainer.src = "Sounds/sound.wav";
}
...

Thanks
My first comment is not to use document.all. Use
document.getElementById("SoundContainer") to manipulate the element in
the DOM correctly.

document.all is the devil! :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top