applet or object?

Discussion in 'HTML' started by JWS, Oct 18, 2007.

  1. JWS

    JWS Guest

    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
    JWS, Oct 18, 2007
    #1
    1. Advertising

  2. JWS

    Neredbojias Guest

    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.

    --
    Neredbojias
    http://www.neredbojias.com/_u/numanumayei.aac
    Neredbojias, Oct 18, 2007
    #2
    1. Advertising

  3. JWS

    JWS Guest

    Neredbojias wrote:
    > 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
    JWS, Oct 18, 2007
    #3
  4. JWS

    Roy A. Guest

    On 18 Okt, 14:24, Neredbojias <> wrote:
    > 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]


    or an ie conditional comment?

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

    > and place the
    > second in an ie conditional comment.
    >
    > --
    > Neredbojiashttp://www.neredbojias.com/_u/numanumayei.aac
    Roy A., Oct 21, 2007
    #4
  5. JWS

    Roy A. Guest

    On 18 Okt, 11:22, JWS <> wrote:
    > 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
    Roy A., Oct 21, 2007
    #5
  6. JWS

    JWS Guest

    Roy A. wrote:

    > 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


    Thanks much! Something in that direction must be the solution. So
    far I haven't been able to quite make it work yet, will report on
    progress later.

    Jan
    JWS, Oct 22, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    616
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    850
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    410
    Andrew Thompson
    Aug 5, 2003
  4. Blah Blah
    Replies:
    0
    Views:
    1,427
    Blah Blah
    Aug 13, 2003
  5. Jade
    Replies:
    3
    Views:
    928
    Roedy Green
    Aug 14, 2003
Loading...

Share This Page