Solved

IE7 runtime error for Java objects

Posted on 2006-07-10
11
441 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now