D
Dobedani
Dear All,
I found the code added below at:
http://simplythebest.net/sounds/sound_guide.html
Unfortunately, the code doesn't seem to work in Firefox. These are the
error messages I can see in my Javascript Console:
Error: self.document.guitar.IsReady is not a function
Error: self.document.guitar.stop is not a function
Are there other functions we have to invoke for FireFox? Any help will
be appreciated!
Kind regards,
Dobedani
<BGSOUND id=BGSOUND_ID src="">
<bgsound id="bgsound_id" loop=1 src="jsilence.mid">
<embed name="guitar" src="malaguena.mid" loop=false autostart=false
hidden=true mastersound>
<script language="JavaScript">
<!--
ver=parseInt(navigator.appVersion)
ie4=(ver>3 && navigator.appName!="Netscape")?1:0
ns4=(ver>3 && navigator.appName=="Netscape")?1:0
ns3=(ver==3 && navigator.appName=="Netscape")?1:0
function playSound() {
if (ie4) document.all['BGSOUND_ID'].src='malaguena.mid';
if ((ns4||ns3)
&& navigator.javaEnabled()
&& navigator.mimeTypes['audio/x-midi']
&& self.document.guitar.IsReady()
)
{
self.document.guitar.play()
}
}
function stopSound() {
if (ie4) document.all['BGSOUND_ID'].src='jsilence.mid';
if ((ns4||ns3)
&& navigator.javaEnabled()
&& navigator.mimeTypes['audio/x-midi']
)
{
self.document.guitar.stop()
}
}
//-->
</script>
<form name=myform>
<input type=button value="Play Sound" onClick="playSound()">
<input type=button value="Stop Sound" onClick="stopSound()">
</form>
I found the code added below at:
http://simplythebest.net/sounds/sound_guide.html
Unfortunately, the code doesn't seem to work in Firefox. These are the
error messages I can see in my Javascript Console:
Error: self.document.guitar.IsReady is not a function
Error: self.document.guitar.stop is not a function
Are there other functions we have to invoke for FireFox? Any help will
be appreciated!
Kind regards,
Dobedani
<BGSOUND id=BGSOUND_ID src="">
<bgsound id="bgsound_id" loop=1 src="jsilence.mid">
<embed name="guitar" src="malaguena.mid" loop=false autostart=false
hidden=true mastersound>
<script language="JavaScript">
<!--
ver=parseInt(navigator.appVersion)
ie4=(ver>3 && navigator.appName!="Netscape")?1:0
ns4=(ver>3 && navigator.appName=="Netscape")?1:0
ns3=(ver==3 && navigator.appName=="Netscape")?1:0
function playSound() {
if (ie4) document.all['BGSOUND_ID'].src='malaguena.mid';
if ((ns4||ns3)
&& navigator.javaEnabled()
&& navigator.mimeTypes['audio/x-midi']
&& self.document.guitar.IsReady()
)
{
self.document.guitar.play()
}
}
function stopSound() {
if (ie4) document.all['BGSOUND_ID'].src='jsilence.mid';
if ((ns4||ns3)
&& navigator.javaEnabled()
&& navigator.mimeTypes['audio/x-midi']
)
{
self.document.guitar.stop()
}
}
//-->
</script>
<form name=myform>
<input type=button value="Play Sound" onClick="playSound()">
<input type=button value="Stop Sound" onClick="stopSound()">
</form>