gvmelle
01-23-2008, 09:39 AM
I have the following code:
<script language="JavaScript"><!--
function EvalSound(soundobj) {
var thissound = eval("document." + soundobj);
thissound.Play();
}//-->
</script>
<embed src="http://weblog.gvmelle.com/images/roffel.mp3" autostart=false hidden=true name="sound1" enablejavascript="true" />
<a href="#" onMouseOver="EvalSound('sound1')">roffel</a>
<img src="http://weblog.gvmelle.com/images/usa.gif" onClick="EvalSound('sound1')">
This is perfectly working under WindowsXP with Firefox 2.0.0.11 an java 1.6.0
but on my Mac OSX 10.5 it works only with Opera en Safari. Not on Firefox nor Camino.
On both OS's I have Quicktime installed.
I get
<embed src="http://weblog.gvmelle.com/images/roffel.mp3" autostart=true hidden=true name="sound1" enablejavascript="true">
working, so It must be either the Eval() function or the onclick/onmouseover that's not compatible.
I tried <script language="JavaScript"><!--
function EvalSound(soundobj) {
var thissound = document.getElementById(soundobj);
thissound.Play();
}
//-->
</script> as function but that gave the same results.
Anyone an idea for a solution?
<script language="JavaScript"><!--
function EvalSound(soundobj) {
var thissound = eval("document." + soundobj);
thissound.Play();
}//-->
</script>
<embed src="http://weblog.gvmelle.com/images/roffel.mp3" autostart=false hidden=true name="sound1" enablejavascript="true" />
<a href="#" onMouseOver="EvalSound('sound1')">roffel</a>
<img src="http://weblog.gvmelle.com/images/usa.gif" onClick="EvalSound('sound1')">
This is perfectly working under WindowsXP with Firefox 2.0.0.11 an java 1.6.0
but on my Mac OSX 10.5 it works only with Opera en Safari. Not on Firefox nor Camino.
On both OS's I have Quicktime installed.
I get
<embed src="http://weblog.gvmelle.com/images/roffel.mp3" autostart=true hidden=true name="sound1" enablejavascript="true">
working, so It must be either the Eval() function or the onclick/onmouseover that's not compatible.
I tried <script language="JavaScript"><!--
function EvalSound(soundobj) {
var thissound = document.getElementById(soundobj);
thissound.Play();
}
//-->
</script> as function but that gave the same results.
Anyone an idea for a solution?