codeexploiter
09-20-2006, 08:38 AM
Hi,
I found some problem while loading a Java applet in Internet Explorer 7 Release Candidate 1.
Please check the following code that I had used for loading the applet in my HTML page.
<SCRIPT LANGUAGE="JavaScript"><!--
var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1"><!--
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf("3.5") < 0)
|| _info.indexOf("Sun") > 0));
//--></SCRIPT></COMMENT>
<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript"><!--
if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0" codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn"> <NOEMBED><XMP>');
else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;" width="0" height="0" code="abc.def.ghi.MyApplet.class" codebase="./" name="MyApplet" archive="MyApplet.jar" TRACE_CGI="on" CONNECTION_TIMEOUT="30" OUTPUT_FUNCTION="addOutput" mayscript="true" pluginspage="http://java.sun.com/j2se/1.4/download.html">
<NOEMBED><XMP>');
//--></SCRIPT>
<applet codebase = "./" code="abc.def.ghi.MyApplet.class" archive="MyApplet.jar" name="MyApplet" width=0 height=0 mayscript>
</XMP>
<PARAM NAME="java_code" VALUE="abc.def.ghi.MyApplet.class">
<PARAM NAME="java_codebase" VALUE="./">
<PARAM NAME="java_type" VALUE="application/x-java-applet;">
<param name="java_archive" value="MyApplet.jar">
<param name="mayscript" value="true">
<param name="TRACE_CGI" value="on">
<param name="CONNECTION_TIMEOUT" value="30">
<param name="OUTPUT_FUNCTION" value="addOutput">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</APPLET></NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET code="XYZApp.class" codebase="html/" align="baseline"
width="200" height="200">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</APPLET>
-->
The above code loads the Applet without any problem in all the other browsers including IE 7 RC1.
But while loading the applet in IE7 it shows a Javascript error on the following line
document.writeln('<EMBED type="application/x-java-applet;" width="0" height="0" code="abc.def.ghi.MyApplet.class" codebase="./" name="MyApplet" archive="MyApplet.jar" TRACE_CGI="on" CONNECTION_TIMEOUT="30" OUTPUT_FUNCTION="addOutput" mayscript="true" pluginspage="http://java.sun.com/j2se/1.4/download.html">
<NOEMBED><XMP>');
Something like unterminated string, this javascript error is not displaying on any other browser. :)
Now what i've done is i've removed the space before <NOEMBED><XMP>'); tag since it is a part of a single document.writelin statement and saved my HTML page and loaded into IE7 RC1 at that point it crashed and shown an error. I'v attached the image of the error message in this post.
When i give that space as i mentioned in my script above the java applet loads and works correctly except that it shows a Javascript error.
I would like to know your thoughts on this issue.
Thanks in advance
I found some problem while loading a Java applet in Internet Explorer 7 Release Candidate 1.
Please check the following code that I had used for loading the applet in my HTML page.
<SCRIPT LANGUAGE="JavaScript"><!--
var _info = navigator.userAgent;
var _ns = false;
var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
//--></SCRIPT>
<COMMENT>
<SCRIPT LANGUAGE="JavaScript1.1"><!--
var _ns = (navigator.appName.indexOf("Netscape") >= 0
&& ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0
&& java.lang.System.getProperty("os.version").indexOf("3.5") < 0)
|| _info.indexOf("Sun") > 0));
//--></SCRIPT></COMMENT>
<!-- The following code is repeated for each APPLET tag -->
<SCRIPT LANGUAGE="JavaScript"><!--
if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0" codebase="http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn"> <NOEMBED><XMP>');
else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;" width="0" height="0" code="abc.def.ghi.MyApplet.class" codebase="./" name="MyApplet" archive="MyApplet.jar" TRACE_CGI="on" CONNECTION_TIMEOUT="30" OUTPUT_FUNCTION="addOutput" mayscript="true" pluginspage="http://java.sun.com/j2se/1.4/download.html">
<NOEMBED><XMP>');
//--></SCRIPT>
<applet codebase = "./" code="abc.def.ghi.MyApplet.class" archive="MyApplet.jar" name="MyApplet" width=0 height=0 mayscript>
</XMP>
<PARAM NAME="java_code" VALUE="abc.def.ghi.MyApplet.class">
<PARAM NAME="java_codebase" VALUE="./">
<PARAM NAME="java_type" VALUE="application/x-java-applet;">
<param name="java_archive" value="MyApplet.jar">
<param name="mayscript" value="true">
<param name="TRACE_CGI" value="on">
<param name="CONNECTION_TIMEOUT" value="30">
<param name="OUTPUT_FUNCTION" value="addOutput">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</APPLET></NOEMBED></EMBED>
</OBJECT>
<!--
<APPLET code="XYZApp.class" codebase="html/" align="baseline"
width="200" height="200">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
</APPLET>
-->
The above code loads the Applet without any problem in all the other browsers including IE 7 RC1.
But while loading the applet in IE7 it shows a Javascript error on the following line
document.writeln('<EMBED type="application/x-java-applet;" width="0" height="0" code="abc.def.ghi.MyApplet.class" codebase="./" name="MyApplet" archive="MyApplet.jar" TRACE_CGI="on" CONNECTION_TIMEOUT="30" OUTPUT_FUNCTION="addOutput" mayscript="true" pluginspage="http://java.sun.com/j2se/1.4/download.html">
<NOEMBED><XMP>');
Something like unterminated string, this javascript error is not displaying on any other browser. :)
Now what i've done is i've removed the space before <NOEMBED><XMP>'); tag since it is a part of a single document.writelin statement and saved my HTML page and loaded into IE7 RC1 at that point it crashed and shown an error. I'v attached the image of the error message in this post.
When i give that space as i mentioned in my script above the java applet loads and works correctly except that it shows a Javascript error.
I would like to know your thoughts on this issue.
Thanks in advance