Solved

IE7 runtime error for Java objects

Posted on 2006-07-10
11
442 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 250 total points
ID: 17079039
then it would sound like a IE bug, it should do that whatever html it tries to load.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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 250 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

803 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