jhesse
10-08-2002, 07:03 PM
Hi everybody,
I'm having difficulties getting this to work. I wrote a Java applet for encryption that I would like to call using Javascript. My code looks something like this:
. . .
<APPLET CODE="Encryption.class" NAME="Encryption" WIDTH=600 HEIGHT=100 MAYSCRIPT></APPLET>
. . .
Password: <input type="password" name="password"> <br>
Input Text: <input type="text" name="inputtext"> <br>
<input type="button" name="encryptButton" value="Encrypt" onClick="encrypted.value = document.Encryption.Encrypt(password.value, inputtext.value"> <br>
Encrypted text: <input type="text" name="encrypted" size="50">
Basically I'm calling the Encrypt method in the Java applet, passing in a password and some text from the HTML form, and putting the output in a text field.
This works perfectly in IE 6.0 running in Windows 2000. It doesn't work in Netscape 4.7. It doesn't work in either browser on the Mac. In Netscape, I need to use a Java plugin--the built-in VM gives me "method verification" errors. With the plugin turned on, the applet runs, but when I push the "encryptButton", Netscape gives me a "document.Encryption has no properties" error. Do I need to use different syntax and/or tags to use the Java plugin?
Any ideas on how I can get this to work in all browsers & platforms (or at least Netscape and Macintosh)?
I'm having difficulties getting this to work. I wrote a Java applet for encryption that I would like to call using Javascript. My code looks something like this:
. . .
<APPLET CODE="Encryption.class" NAME="Encryption" WIDTH=600 HEIGHT=100 MAYSCRIPT></APPLET>
. . .
Password: <input type="password" name="password"> <br>
Input Text: <input type="text" name="inputtext"> <br>
<input type="button" name="encryptButton" value="Encrypt" onClick="encrypted.value = document.Encryption.Encrypt(password.value, inputtext.value"> <br>
Encrypted text: <input type="text" name="encrypted" size="50">
Basically I'm calling the Encrypt method in the Java applet, passing in a password and some text from the HTML form, and putting the output in a text field.
This works perfectly in IE 6.0 running in Windows 2000. It doesn't work in Netscape 4.7. It doesn't work in either browser on the Mac. In Netscape, I need to use a Java plugin--the built-in VM gives me "method verification" errors. With the plugin turned on, the applet runs, but when I push the "encryptButton", Netscape gives me a "document.Encryption has no properties" error. Do I need to use different syntax and/or tags to use the Java plugin?
Any ideas on how I can get this to work in all browsers & platforms (or at least Netscape and Macintosh)?