Solved

IE7 runtime error for Java objects

Posted on 2006-07-10
11
440 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
triangle challenge 4 79
network + 7 73
topping2 challenge 13 61
Saving Tweets with emojis using Twitter4J in a Mysql table 2 53
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 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

21 Experts available now in Live!

Get 1:1 Help Now