applet or object?

J

JWS

This must surely be a FAQ, but Googling hasn't helped much so far.

I am trying to learn Java, because one of my pages needs an
applet. The question is: how to put the applet on the page, in
such a way that the applet works both in Mozilla and IE, *and* the
page still validates as HTML 4.01 strict.

I tried

<p>
<object codetype="application/java"
classid="java:DrawingLines.class"
width="300" height="300">
You should have seen a Java applet that draws lines.
</object>

which is valid html strict, it works in Mozilla (XP and Linux),
but IE7 only shows the fallback text.

If I say

<p>
<applet code="DrawingLines.class" width="300" height="300">
You should have seen a Java applet that draws lines.
</applet>

it works in Mozilla and IE7, but does not validate as html strict.
Is there a better way to do this, or should I just not bother and
be happy with validation as "transitional"?

Jan
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Thu, 18 Oct 2007 09:22:43 GMT
JWS scribed:
This must surely be a FAQ, but Googling hasn't helped much so far.

I am trying to learn Java, because one of my pages needs an
applet. The question is: how to put the applet on the page, in
such a way that the applet works both in Mozilla and IE, *and* the
page still validates as HTML 4.01 strict.

I tried

<p>
<object codetype="application/java"
classid="java:DrawingLines.class"
width="300" height="300">
You should have seen a Java applet that draws lines.
</object>

which is valid html strict, it works in Mozilla (XP and Linux),
but IE7 only shows the fallback text.

If I say

<p>
<applet code="DrawingLines.class" width="300" height="300">
You should have seen a Java applet that draws lines.
</applet>

it works in Mozilla and IE7, but does not validate as html strict.
Is there a better way to do this, or should I just not bother and
be happy with validation as "transitional"?

Insert the first example using some method to hide it from ie [which
probably would be javascript- or server-side scripting] and place the
second in an ie conditional comment.
 
J

JWS

Neredbojias said:
JWS scribed:
it works in Mozilla and IE7, but does not validate as html
strict. Is there a better way to do this, or should I just
not bother and be happy with validation as "transitional"?

Insert the first example using some method to hide it from ie
[which probably would be javascript- or server-side scripting]
and place the second in an ie conditional comment.

Seems too complicated! I guess I won't bother, then.

Thanks,
Jan
 
R

Roy A.

Well bust mah britches and call me cheeky, on Thu, 18 Oct 2007 09:22:43 GMT
JWS scribed:


This must surely be a FAQ, but Googling hasn't helped much so far.
I am trying to learn Java, because one of my pages needs an
applet. The question is: how to put the applet on the page, in
such a way that the applet works both in Mozilla and IE, *and* the
page still validates as HTML 4.01 strict.
<p>
<object codetype="application/java"
classid="java:DrawingLines.class"
width="300" height="300">
You should have seen a Java applet that draws lines.
</object>
which is valid html strict, it works in Mozilla (XP and Linux),
but IE7 only shows the fallback text.
<p>
<applet code="DrawingLines.class" width="300" height="300">
You should have seen a Java applet that draws lines.
</applet>
it works in Mozilla and IE7, but does not validate as html strict.
Is there a better way to do this, or should I just not bother and
be happy with validation as "transitional"?

Insert the first example using some method to hide it from ie [which
probably would be javascript- or server-side scripting]

or an ie conditional comment?

<!--[if !IE]> <!-->
....
 
R

Roy A.

This must surely be a FAQ, but Googling hasn't helped much so far.

I am trying to learn Java, because one of my pages needs an
applet. The question is: how to put the applet on the page, in
such a way that the applet works both in Mozilla and IE, *and* the
page still validates as HTML 4.01 strict.

I tried

<p>
<object codetype="application/java"
classid="java:DrawingLines.class"
width="300" height="300">
You should have seen a Java applet that draws lines.
</object>

which is valid html strict, it works in Mozilla (XP and Linux),
but IE7 only shows the fallback text.

If I say

<p>
<applet code="DrawingLines.class" width="300" height="300">
You should have seen a Java applet that draws lines.
</applet>

it works in Mozilla and IE7, but does not validate as html strict.
Is there a better way to do this, or should I just not bother and
be happy with validation as "transitional"?

I think you can use the object element in IE7 too. Have a look at this
link:

http://joliclic.free.fr/html/object-tag/en/object-java.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top