By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

Using the object tag in IE

P: n/a
>From the book I am using as a reference I understood that applet tag
was deprecated, but googling for information, and testing myself, it
seems IE does not work properly with this new object tag. So my effort
reading about the object tag was for nothing? Is there no way I can
make this work for IE and Mozilla?

<HTML>
<HEAD>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<CENTER>
<object classid="java:AwtCalcApplet.class"
archive="AwtCalc.jar"
type="application/x-java-applet"
codebase="."
width = "220"
height = "150" >
I do not have any object that is why I display this text
</object>
</CENTER>
</BODY>
</HTML>

Dec 9 '05 #1
Share this Question
Share on Google+
30 Replies


P: n/a
After some investigation I made this, I guess this works ok.

<br/>
<br/>
<br/>
<form action="scan" method="POST">
<center>
<div Id='appie'></div>
</form>

<script>
var target = document.getElementById('appie');
// alert(target);
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// alert(InternetExplorer);
if (InternetExplorer != true)
{
// alert('mozilla');
target.innerHTML = "<object classid='java:AwtCalcApplet.class'
archive='/AwtCalc.jar' type='application/x-java-applet' codebase='/'
width='220' height='150'> I do not have any object that is why I
display this text </object>";
}
else
{
// alert('internet explorer');
target.innerHTML = "<applet code = 'AwtCalcApplet.class' archive
= '/AwtCalc.jar' width = '220' height = '150'> </applet>";
};
</script>

Dec 9 '05 #2

P: n/a
On 09/12/2005 10:12, marc wrote:
From the book I am using as a reference I understood that applet tag
was deprecated,
Correct. It has been for a long time.
but googling for information, and testing myself, it seems IE does
not work properly with this new object tag.
It does, but not so readily as other browsers.
So my effort reading about the object tag was for nothing?
Not at all.
Is there no way I can make this work for IE and Mozilla?
Yes. See
<http://groups.google.co.uk/group/alt.html/browse_frm/thread/1a71a3fd69503de8/d4b02174e1cf3f16#d4b02174e1cf3f16>

[snip]
<BODY BGCOLOR="FFFFFF">
<CENTER>


The bgcolor attribute and CENTER element are also deprecated. Use CSS,
instead.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 9 '05 #3

P: n/a
marc wrote:
After some investigation I made this, I guess this works ok.

<br/>
<br/>
<br/>
<form action="scan" method="POST">
<center>
<div Id='appie'></div>
</form>
<shudder/> I guess not. <URL:http://validator.w3.org/>
[nonsensical invalid code snipped]

PointedEars
Dec 9 '05 #4

P: n/a
Euh yeah well, what can I say, at least I have bookmarked the url that
will point me to the validator from now on...

Dec 9 '05 #5

P: n/a
marc wrote:
Euh yeah well, what can I say, at least I have bookmarked the url that
will point me to the validator from now on...


That is a start. You could continue with switching to HTML 4.01 Strict
that IE supports (in contrast to XHTML) and to the not-at-all-deprecated
`applet' element, correcting the invalid code, stop using the nonsensical
browser switch

<URL:http://pointedears.de/scripts/test/whatami>

and quoting the minimum of what you are replying to on Usenet (in
Google Groups: "Options", "Reply") as described in the newsgroup's FAQ

<URL:http://jibbering.com/faq/>

which also points out that with Java applets, unless scripted with
client-side J(ava)Script/ECMAScript, you are completely off-topic
here since

Java != JavaScript
HTH & HAND

PointedEars
Dec 9 '05 #6

P: n/a
On 09/12/2005 16:17, Thomas 'PointedEars' Lahn wrote:
[...] You could continue with [...] the not-at-all-deprecated
`applet' element [...]


The APPLET element /is/ deprecated.

APPLET is deprecated (with all its attributes) in favor of
OBJECT.
-- 13.4 Including an applet: the APPLET element, HTML 4.01

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 9 '05 #7

P: n/a
> which also points out that with Java applets, unless scripted with
client-side J(ava)Script/ECMAScript, you are completely off-topic
here since
Java != JavaScript


Yeah, ok, but I am actually wondering if I should the object tag or the
applet tag to call the applet from html and javascript. (The applet I
am using is just an example from internet.)

Dec 9 '05 #8

P: n/a
Michael Winter wrote:
On 09/12/2005 16:17, Thomas 'PointedEars' Lahn wrote:
[...] You could continue with [...] the not-at-all-deprecated
`applet' element [...]


The APPLET element /is/ deprecated.

APPLET is deprecated (with all its attributes) in favor of
OBJECT.
-- 13.4 Including an applet: the APPLET element, HTML 4.01


Indeed, my bad. So he needs to declare HTML 4.01 Transitional, not Strict.
Still better than using "browser detection" to serve either the `object' or
the `applet' element in XHTML 1.0 (Transitional/Strict) or even XHTML 1.1+.
PointedEars
Dec 9 '05 #9

P: n/a
marc wrote:

Please provide attribution of quoted material.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
which also points out that with Java applets, unless scripted with
client-side J(ava)Script/ECMAScript, you are completely off-topic
here since
Java != JavaScript


Yeah, ok, but I am actually wondering if I should the object tag or the
applet tag to call the applet from html and javascript. (The applet I
am using is just an example from internet.)


Declare HTML 4.01 Transitional and use the `applet' element, Sun says the
Java plugin supports that element. I am not a Java developer, though, so
RTFM (and note that it includes deprecated and even nonsensical examples
as well).

<URL:http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/contents.html>
PointedEars
Dec 9 '05 #10

P: n/a
On 09/12/2005 16:43, Thomas 'PointedEars' Lahn wrote:

[To use APPLET]
So he needs to declare HTML 4.01 Transitional, not Strict.
That is an option, though not necessarily the only one. I never did
ascertain just how far my suggestion in my other post will go to satisfy
other browsers, and no-one in a.html seemed keen to contribute.
Still better than using "browser detection" to serve either the
`object' or the `applet' element in XHTML 1.0 (Transitional/Strict)
or even XHTML 1.1+.


Absolutely.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 9 '05 #11

P: n/a

"Thomas 'PointedEars' Lahn" <Po*********@web.de> schreef
I am not a Java developer, though, so
RTFM (and note that it includes deprecated and even nonsensical examples
as well).


Hey Thomas, if you are going to continue this attitude in all your advice
you are going to give me, I'd rather not have it. Thank you!
Dec 11 '05 #12

P: n/a

"Thomas" :
Still better than using "browser detection" to serve either the
`object' or the `applet' element in XHTML 1.0 (Transitional/Strict)
or even XHTML 1.1+.

"Michael Winter" :
Absolutely.


Is this really thát bad? I know the code I tried to use is not what an
experienced javascript programmer would use. As an absolute or relative
excuse: I am writing code in it for a few weeks only, and only have written
non web stuff before (only windows applications, no html nor nothing).

But there is one other thing to say about my project. It is an intranet
application, so I can be reasonably certain the browser the client uses, is
one of two, IE or Mozilla. Since only these two browsers are installed in
the company's P.C. Also the program will be inevitable I think, client side
dependant, since I should write a program for loading images with a scanner.
This scanner must be present on the client side so...

Nevertheless, your suggestions are neater, and I will try them and read the
information provided, thank you.
Dec 11 '05 #13

P: n/a

"Thomas 'PointedEars' Lahn" <Po*********@web.de> schreef
Please provide attribution of quoted material.
Well, google posting is a bugger really, I will in future write 'who wrote
what' in my replies.
Declare HTML 4.01 Transitional and use the `applet' element
One problem: Since I am working together with some other people in a larger
project, I cannot decide that my page would be of a certain standard.

URL:http://java.sun.com/j2se/1.4.2/docs/.../contents.html

This is a very usefull link thank you.

Marc
Dec 11 '05 #14

P: n/a
On 11/12/2005 08:39, Marc wrote:
Michael Winter wrote:
Thomas Lahn wrote:
Still better than using "browser detection" to serve either the
`object' or the `applet' element in XHTML 1.0
(Transitional/Strict) or even XHTML 1.1+.
Absolutely.


Is this really thát bad?


Yes, for two reasons.

The first and foremost is that browser detection is unreliable. The
conditional comments I used in that post to a.html are a proprietary
mechanism for IE and should remain reliable, but even they are
unnecessary. However, as it means that the PARAM elements only need to
be included once, I thought I may as well use them.

The second is that many browsers, including IE, do not support XHTML.
Unless serving XHTML 1.0 (/not/ 1.1) as malformed HTML somehow brings
overwhelming advantages (and it usually won't), just stick to HTML 4.01.

[snip]
But there is one other thing to say about my project. It is an
intranet application [...]


You really should mention things like that upfront. :)

This group assumes, as set out in the FAQ, that the context of a post
will be the Web in general (as this is the most common case) unless
stated otherwise.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 11 '05 #15

P: n/a
Michael Winter wrote:
On 11/12/2005 08:39, Marc wrote:
But there is one other thing to say about my project. It is an
intranet application [...]


You really should mention things like that upfront. :)

This group assumes, as set out in the FAQ, that the context of a post
will be the Web in general (as this is the most common case) unless
stated otherwise.


However, that it is used in an Intranet application does not mean that it
is not important on how it is implemented. Using browser detection instead
of feature detection will increase maintenance costs in the mid-term. An
interoperable solution therefore is always the best approach.
PointedEars
Dec 11 '05 #16

P: n/a
Mike:
Yes. See
<http://groups.google.co.uk/group/alt.html/browse_frm/thread/1a71a3fd6...>


Mike, what is this magic number
"8AD9C840-044E-11D1-B3E9-00805F499D93"?

If I search around it seems that it is used very often, and it seems it
is not a UID that is dependent of the applet, but a sort of alternative
'active x class number', that indicates that it is not an active x
object but a java applet. Hence the number is the same for all applets,
and which specific applet to start is identified in the parameters?

But that's just so weird, I cannot believe it's programmed this way.

First I thought I should somehow get a specific class id number for
each applet, somehow. Or I should register a number in the registry?

I am confused by this...

Dec 12 '05 #17

P: n/a
I wrote:

"Mike, what is this magic number
"8AD9C840-044E-11D1-B3E9-00805F499D93"? "

Seems my presumption are true:

http://java.sun.com/j2se/1.4.2/docs/...sing_tags.html

Attribute classid:

"It should always have the same value for dynamic version support, i.e.
clsid:8AD9C840-044E-11D1-B3E9-00805F499D93. For static version support
it will have a unique value for the version, e.g.,
clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA."

Still think it's a bit strange, but nevertheless...

Dec 12 '05 #18

P: n/a
VK

marc wrote:
From the book I am using as a reference I understood that applet tag

was deprecated, but googling for information, and testing myself, it
seems IE does not work properly with this new object tag. So my effort
reading about the object tag was for nothing? Is there no way I can
make this work for IE and Mozilla?


Leaving out that Java applets (not applications!) is mainly dead
technologie:

<object> for Java is *very bad* because it implies a particular JVM to
use. In the mixed environment (IE / others) it often happens that IE
uses much more effective Microsoft JVM and "others" have to function
under Sun plugin. More over "others" may have Sun plugin of one version
and your <object> will imply another version. Sun did so many plugin
variants and patches that they have lost the count themselves. It
caused in the past several major virus-like epidemies across
Java-users: you have plugin 1.3.0, applet object codebase implies
1.3.1, it downloads 1.3.1, breaks your 1.3.0 plus make it default VM
for Microsoft which already had MS JVM...etc...
All together is the best way to make the whole system dizzy. Sometimes
you have to reinstall the entire Java segment on your computer after
viewing <object>-enforced Java applet. The above statement is a blood
written one, trust me.

To somehow fix this "Java-virus" Sun introduced classid
8AD9C840-044E-11D1-B3E9-00805F499D93 which internally supposes to mean
"the latest JVM you installed on this machine". Still it doesn't help
to prevent IE with Microsoft JVM installed from failure because
Microsoft JVM classid is 08B0E5C0-4FCB-11CF-AAA5-00401C608500

<applet> tag means "use any JVM you have - if you have any". Despite it
is deprecated but at least it's secure against of occasional system
damages.

If you still want to have applets on your page, use the old
Microsoft-proposed workaround:

<applet class="myClass.class"
cabbase="myApplet.cab"
archive="myApplet.jar"
....
After meeting "cabbase" MS JVM will ignore "archive".
Sun JVM will ignore "cabbase" and use archive.

It means that you'll have to have two archives (.jar and .cab)
Also Microsoft discontinued to support Java (but one can still find and
install the last version of MS JVM)

And indeed all this question is nothing to do with JavaScript or
JScript.

Dec 12 '05 #19

P: n/a
VK:

"And indeed all this question is nothing to do with JavaScript or
JScript."

Nevertheless it is an eye opener for me, so you got my gratitude!

Dec 12 '05 #20

P: n/a
On 12/12/2005 12:02, VK wrote:

[snip]
Leaving out that Java applets (not applications!) is mainly dead
technologie:
'Dead' isn't the right word. Like other third-party technologies,
including Flash, not everyone will have it, so expecting it to work
reduces the size of your audience.
<object> for Java is *very bad* because it implies a particular JVM to
use.
For IE, perhaps.
In the mixed environment (IE / others) it often happens that IE
uses much more effective Microsoft JVM
The Microsoft JVM? Now that /is/ dead. Recent versions of Windows won't
have it installed, anyway. Microsoft no longer continue to develop it,
and advise everyone that has it to migrate to something else. It is also
quite possible that the MSJVM will be too old to support a more recently
written applet (I'm not going to write one to check).
and "others" have to function under Sun plugin.
And that something else is likely to be the Sun Microsystems JRE.
More over "others" may have Sun plugin of one version and your
<object> will imply another version.
For browsers other than IE, there is no implied version. Certainly not
with the code I suggested. Moreover, IE will be instructed to use the
latest version, whatever that might be.

[snip]
It caused in the past several major virus-like epidemies across
Java-users: you have plugin 1.3.0, applet object codebase implies
1.3.1, it downloads 1.3.1, breaks your 1.3.0 plus make it default VM
for Microsoft which already had MS JVM...etc...


That seems to be scaremongering, though not something I'm in a position
to test.

Yes, the codebase attribute can be used automatically update the JRE if
it indicates that a newer version is necessary to use the applet, but
that it will break anything is a dubious notion, otherwise Microsoft
wouldn't allow it to happen.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 12 '05 #21

P: n/a
On 12/12/2005 10:01, marc wrote:

[snip]
Mike, what is this magic number
"8AD9C840-044E-11D1-B3E9-00805F499D93"?


Simply put, it identifies the Java Run-time Environment in the Windows
Registry. IE will try to find it using that value, run it, and pass the
applet to it.

Other plug-ins, like Flash, also have these identifiers.

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Dec 12 '05 #22

P: n/a
VK

Michael Winter wrote:
*very respectfully* <snip>
pls see the thread for details


The problem resides in the very nature of <object>: it implies *a
particular instance of a particular application". If you manage to
force <object> to work like "gimme something of such kind" it will be
already a misuse of the <object> tag. Plus such misuse will not be
guaranteed (and why should it?) across all platforms and applications.

Microsoft JVM is indeed not supported anymore by Microsoft but stull
there are hundreds of places to download the last official update, plus
it is still manageable through the IE settings (up to IE 6.x) The
reason why many Windows-people choose MS JVM (even not supported
anymore) over Sun JVM is the speed (turtle vs. light).

To OP: if my IE vs. People story was interesting to you then you indeed
want to support MS JVM? If so, then you have to forget the Swing sick
sh**. I guess it's clear to you?

Dec 12 '05 #23

P: n/a
VK wrote:
Michael Winter wrote:
*very respectfully* <snip>
pls see the thread for details
The problem resides in the very nature of <object>: it implies *a
particular instance of a particular application".


It does not.
If you manage to force <object> to work like "gimme something of
such kind" it will be already a misuse of the <object> tag. [...]


No, it is not. Sun itself states that the special Class ID
8AD9C840-044E-11D1-B3E9-00805F499D93 will always refer to the latest
installed version of the JRE, no matter what version that might be --
they call that "dynamic versioning". It is also stated that the JRE
Plugin supports the `object' element since it was officially introduced
in browsers (NN6 [1998]; IE3 [1996-08], IE4 [1997-10] for scripts).

Could we please return to discussing on-topic -- J(ava)Script/ECMAScript?
PointedEars
Dec 12 '05 #24

P: n/a
VK:
To OP: if my IE vs. People story was interesting to you then you indeed
want to support MS JVM?


Well since it is an intranet application and I can be fairly sure about
the present and future browsers used, I just made this. Although some
would shudder form my code I guess, it works for me.

<form action="scan" method="post">
<br/>
<br/>
<!--[if IE]>
<applet code='JTwainApplet.class' archive='/JTwain.jar' codebase='/' >
</applet>
<![endif]-->
<![if !IE]>
<object classid='java:JTwainApplet.class' archive='/JTwain.jar'
type='application/x-java-applet' codebase='/'> </object>
<![endif]>
</form>

Dec 13 '05 #25

P: n/a
On 2005-12-12, marc <ma*********@hotmail.com> wrote:
"8AD9C840-044E-11D1-B3E9-00805F499D93"?

If I search around it seems that it is used very often, and it seems it
is not a UID that is dependent of the applet, but a sort of alternative
'active x class number', that indicates that it is not an active x
object but a java applet. Hence the number is the same for all applets,
and which specific applet to start is identified in the parameters?

But that's just so weird, I cannot believe it's programmed this way.

First I thought I should somehow get a specific class id number for
each applet, somehow. Or I should register a number in the registry?

I am confused by this...


Why can't the java engine be the activex object?

Bye.
Jasen
Dec 13 '05 #26

P: n/a
Jasen:
Why can't the java engine be the activex object?


Ok..., Jasen, you probably mean the engine can be the activex object?
But could you please explain more, and not just make a remark, which
they would call I think in German Klug Scheisserei or something. What
the English term for this is I do not know. Or to say it in Dutch, stop
the 'betweterij' and explain what you bedoelt.

So you can register any engine, JRE or also for example Flash in the
same whey as an active x object, and IE would call it by the same means
as an active x object, right?? That's essentially what happens?

And I excuse myself to Pointer Ears, who probably shudders at this
moment for all this off topic content, sorry, sorry.

Dec 13 '05 #27

P: n/a
marc wrote:
Jasen:
Why can't the java engine be the activex object?


Ok..., Jasen, you probably mean the engine can be the activex object?
But could you please explain more, and not just make a remark, which
they would call I think in German Klug Scheisserei or something. [...]
And I excuse myself to Pointer Ears, who probably shudders at this
moment for all this off topic content, sorry, sorry.


PLONK
Dec 13 '05 #28

P: n/a
Man you are a sick joke really! Typical German Klug Scheisser!

Dec 13 '05 #29

P: n/a
Me:
But could you please explain more, and not just make a remark, which
they would call I think in German Klug Scheisserei or something. [...]
....
> And I excuse myself to Pointer Ears, who probably shudders at this
moment for all this off topic content, sorry, sorry.

Thomas:
PLONK


Ooops....well sorry....

Euh, well actually, that probably...sounds a bit anti German, but
that's not what I meant. I am not anti German. It's just the perfect
word, in German, for something like what people sometimes do. Make one
clever remark, and then don't explain what they really mean. I am very,
very anti Klug Scheisserei though, that is true.

Nevertheless I will study some more on this subject in general. That's
probably the best to do then :-)

Better then bothering you so much, hey ;-)

Dec 13 '05 #30

P: n/a

"marc" <ma*********@hotmail.com> schreef
...Klug Scheisser!


Oh, man, I hate posting with google, I do apoligize for that message. I
wanted to cancel it, but it still there...:-(

Thomas, if I am irritated, which I am, absolutely one hundered procent, the
real cause is my own lack of knowlegde, and my stupid impulsive behavior.
Your help though is, in contrary to my knowlegde, absolutely brilliant. So
my thanks even! You're just great.

Dec 13 '05 #31

This discussion thread is closed

Replies have been disabled for this discussion.