?
Solved

IE7 runtime error for Java objects

Posted on 2006-07-10
11
Medium Priority
?
460 Views
Last Modified: 2013-12-29
Hi X-perts.

Here is the situation:

1. Java <applet></applet> construction is not reckognized by ie, if no jre installed (as expected)
2. Changing it to <object></object> works fine in ie, but not in Firefox, which required <applet></applet> structure.
Here we come to the point-->

3. If I run my code through HtnlConvertor from Java, the generated code runs on all platforms except the latest ie7, which generates a Runtime Error, though ie7 works fine for a simple <object></object> construction.

What could be wrong in a the following code (abstract) for ie7:

<script language="JavaScript" type="text/javascript"><!--
    if (_ie == true) document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "326" HEIGHT = "306" NAME = "3Dvrunner"  codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"><noembed><xmp>');
//--></script>
<applet  CODE = "test.class" JAVA_CODEBASE = "." ARCHIVE = "vrv.jar" WIDTH = "326" HEIGHT = "306" NAME = "3Drunner" MAYSCRIPT = true></xmp>
    <PARAM NAME = CODE VALUE = "test.class" >
    <PARAM NAME = CODEBASE VALUE = "." >
    <PARAM NAME = ARCHIVE VALUE = "vrv.jar" >
etc etc
   

<TABLE width="326" height="306"><TR><TD bgcolor="#FFFFFF" align="center" valign="middle">
If the viewer does not load, click <a href="http:/...">here</a>
</TD></TR></TABLE>
</applet>
</noembed>
</embed>

====================
The code that ie7 takes fine is:

<object
    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"
    WIDTH = "326" HEIGHT = "306" NAME = "3Drunner" >
    <PARAM NAME = CODE VALUE = "test.class" >
    <PARAM NAME = CODEBASE VALUE = "." >
    <PARAM NAME = ARCHIVE VALUE = "vrv.jar" >
    etc etc

    <TABLE width="326" height="306"><TR><TD bgcolor="#FFFFFF" align="center" valign="middle">
If the viewer does not load, click <a href="http:/....u">here</a>
</TD></TR></TABLE>
</object>
</object>

Please, help as it is a very urgent project

Thanks

-A-
0
Comment
Question by:andy7789
  • 6
  • 4
11 Comments
 
LVL 92

Expert Comment

by:objects
ID: 17079004
what exactly is the runtime error?  may be a bug in IE7
0
 

Author Comment

by:andy7789
ID: 17079014
just abnormal program termination no id. I am puzzled because it works for a direct <object> class
0
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 17079039
then it would sound like a IE bug, it should do that whatever html it tries to load.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:andy7789
ID: 17079055
It does not make my life easier, if some customers would have a new ie7, they will always blame my site if it crashes... I have to find a fix for it
0
 

Author Comment

by:andy7789
ID: 17079063
it crashes on this point:

<script language="JavaScript" type="text/javascript"><!--
    if (_ie == true) document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "326" HEIGHT = "306" NAME = "3Dvrunner"  codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"><noembed><xmp>');
//--></script>

if I remove it, no crashes
0
 

Author Comment

by:andy7789
ID: 17079122
I have found a fix! Ie7 does not understand a long string for writeln. If I change it to:

    if (_ie == true) document.writeln('
      <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"   codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"
      WIDTH = "326" HEIGHT = "306" NAME = "3Dviewer">
      <noembed><xmp>');

it works fine!!!
0
 
LVL 92

Expert Comment

by:objects
ID: 17079132
nice enhancement from M$ :)
0
 

Author Comment

by:andy7789
ID: 17079272
I was too quick -- the M$ piece of art rally crashes on a simple script

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript"><!--
 
      document.writeln('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"');
      document.writeln('object>');

      //--></script>

</head>

<body>
</body>
</html>

It cannot take a classid string!! I will place this question on JScript forum right now
0
 
LVL 8

Assisted Solution

by:colr__
colr__ earned 750 total points
ID: 17080192
IE 7 is still in Beta and so even if you get this working, on the next (Beta?) release, it may be broken again. I know this doesnt solve your problem, but if your coding around IE 7, remember that itself is still in development and so subject to change.
0
 

Author Comment

by:andy7789
ID: 17080257
I have manage to find a solution (a bad one, but still  - something). instead of checking if ie == true, I check if ie == false and build a conditional if() object for Firefox. IE just takes a direct <object> class and there is no need to make if() condition for ie.

I would appreciate someone to give me a better solution.

thanks
-A-
0
 
LVL 92

Expert Comment

by:objects
ID: 17080281
I'd be initially saying IE7 is not yet supported (as it is still in beta).
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question