jazz
07-01-2003, 02:07 AM
I got the following script off of javascripts.com and apparently it should work in Netscape as well as I.E. However the on/off button does not work in Netscape. Any ideas why? Is there another script that does the same thing and is cross browser compatible?
Thanks!
SCRIPT:
<!-- This script has been in the http://www.javascripts.com Javascript Public Library! -->
<!-- Note that though this material may have been in a public depository, certain author copyright restrictions may apply. -->
<html>
<head>
<title>My Script-by Me</title>
</head>
<body>
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}
function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}
//--></script>
<body>
<embed name="midi" src="http://www.jimlowe.freeserve.co.uk/battle-3.mid" width="128" height="128" hidden>
<p>
<form name="onoff"
<p><input type="button" value="Turn music off" name="B1" onClick="changeButton()" style="color: #FFFFFF; background-color: #6699FF; font-family: Tahoma; font-size: 10pt">
</form>
</body>
</html>
<!-- Simba says Roar. -->
Thanks for any advice!
Eli
Thanks!
SCRIPT:
<!-- This script has been in the http://www.javascripts.com Javascript Public Library! -->
<!-- Note that though this material may have been in a public depository, certain author copyright restrictions may apply. -->
<html>
<head>
<title>My Script-by Me</title>
</head>
<body>
<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}
function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}
//--></script>
<body>
<embed name="midi" src="http://www.jimlowe.freeserve.co.uk/battle-3.mid" width="128" height="128" hidden>
<p>
<form name="onoff"
<p><input type="button" value="Turn music off" name="B1" onClick="changeButton()" style="color: #FFFFFF; background-color: #6699FF; font-family: Tahoma; font-size: 10pt">
</form>
</body>
</html>
<!-- Simba says Roar. -->
Thanks for any advice!
Eli