Solved

IE7 runtime error for Java objects

Posted on 2006-07-10
11
448 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

724 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