views:

134

answers:

1

Hi, I have problem with calling a java function from javascript. Although it works for other browsers like IE, Firefox and chrome, it doesn't in safari.

Here is my code.

<HTML>
<HEAD>
<TITLE>Simple Applet Example</TITLE>
<SCRIPT>
function callSpin()
{   
    document.getElementById("myslotmachine").spin();
}


</SCRIPT>
</HEAD>
<BODY>
<applet hspace="0" height="240" width="510" vspace="0" border="0" code="testSlot" id="myslotmachine"> </applet>
<form name="myForm" method="post" action="">
<input type="button" name="Button" value="Button" onClick="callSpin()">
</form>
</BODY>
</HTML>

Does anybody know why safari has this problem and how to solve it out?

Thanks in advance.

Mona

A: 

Try to add the mayscript attribute to the <applet> tag:

<applet ... mayscript> </applet>
KennyTM
Hi Kenny, Tks for your answers. I've tried that and still cannot.
Mona