JavaScript Java function call not working in Safari

I have a problem with calling a java function from javascript. Although it works for other browsers like IE, Firefox and Chrome, it is not 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 anyone know why safari has this problem and how to solve it?

Thanks in advance.

Mona

+3
source share
1 answer

Try adding an attribute mayscriptto the tag <applet>:

<applet ... mayscript> </applet>
0
source

Source: https://habr.com/ru/post/1734352/


All Articles