Why this code is invalid?

Discussion in 'HTML' started by Guest, Oct 15, 2005.

  1. Guest

    Guest Guest

    Hello,
    Here's my invalid code in the shortened version:
    =============
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-2">
    <title></title>

    </head>
    <body>
    </body>
    </html>
    ==================
    http://validator.w3.org/ says:

    Error Line 9 column 5: document type does not allow element "BODY" here.
    <body>

    Error Line 11 column 6: end tag for "HTML" which is not finished.
    </html>

    What's wrong?

    Regards,
    Talthen
    Guest, Oct 15, 2005
    #1
    1. Advertising

  2. Guest

    Guest Guest

    <>
    <<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

    Heh, should be:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    Regards,
    Talthen
    Guest, Oct 15, 2005
    #2
    1. Advertising

  3. Guest

    Arne Guest

    Once upon a time ** wrote:
    > <>
    > <<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
    >
    > Heh, should be:
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    >


    Yepp, if you have site built with frames, only the frameset file use
    the frameset DTD. All other pages should have the transitional DTD,
    but better than showed above is

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    and

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">

    to make the pages rendered in standard mode, not quirks mode :)

    --
    /Arne
    Now killing all top posters and posters who don't quote
    * How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
    * From Google: http://www.safalra.com/special/googlegroupsreply/
    -------------------------------------------------------------
    Arne, Oct 15, 2005
    #3
  4. Guest

    Guest Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    "Arne" <>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    > "http://www.w3.org/TR/html4/frameset.dtd">
    >
    > to make the pages rendered in standard mode, not quirks mode :)


    Well... without DOCTYPE pages are smaller :p Also px in width, type in
    <script and <title are things that, when ommitted make the page smaller :]
    Even Mozilla can render such pages, however I don't understand why MSIE and
    Opera can understand this:
    document.forms[0].goto.value=x;
    and Mozilla can't. W3C validator also doesn't make errors on it. Stupid
    mozilla- I lost few hours to find this out :p

    Regards,
    Talthen
    Guest, Oct 15, 2005
    #4
  5. Re: Why this code is invalid? [+stupid=mozilla :p ]

    wrote:
    > "Arne" <>
    >
    >><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    >> "http://www.w3.org/TR/html4/frameset.dtd">
    >>
    >>to make the pages rendered in standard mode, not quirks mode :)

    >
    >
    > Well... without DOCTYPE pages are smaller :p Also px in width, type in
    > <script and <title are things that, when ommitted make the page smaller :]
    > Even Mozilla can render such pages, however I don't understand why MSIE and
    > Opera can understand this:
    > document.forms[0].goto.value=x;
    > and Mozilla can't. W3C validator also doesn't make errors on it. Stupid
    > mozilla- I lost few hours to find this out :p


    No your problem is 'goto' is a JavaScript reserve word!!!

    JavaScript Reserve Words:

    abstract, boolean, break, byte, case, catch, char, class, const,
    continue, debugger, default, delete, do, double, else, enum, export,
    extends, false, final, finally, float, for, function, goto, if,
    implements, import, in, instanceof, int, interface, long, native, new,
    null, package, private, protected, public, return, short, static, super,
    switch, synchronized, this, throw, throws, transient, true, try, typeof,
    var, void, volatile, while, with

    Change the name and it works just fine, Mozilla is just being smart
    enough to know that you made an error:


    <script type="text/javascript">
    function proof(){
    var x="Some value";
    document.forms[0].notgoto.value=x;
    }
    </script>
    <form>
    <input name="notgoto" type="text">
    <input type="button" onclick="proof()" value="Works">
    </form>


    Try for yourself ;-)


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 15, 2005
    #5
  6. Guest

    Toby Inkster Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    talthen.z-serwera.o2 wrote:

    > document.forms[0].goto.value=x;
    > W3C validator also doesn't make errors on it.


    W3C doesn't have a Javascript validator, does it?

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Oct 15, 2005
    #6
  7. Guest

    Arne Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    Once upon a time ** wrote:

    > "Arne" <>
    >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    >> "http://www.w3.org/TR/html4/frameset.dtd">
    >>
    >> to make the pages rendered in standard mode, not quirks mode :)

    >
    > Well... without DOCTYPE pages are smaller :p Also px in width, type in
    > <script and <title are things that, when ommitted make the page smaller :]
    > Even Mozilla can render such pages, however I don't understand why MSIE and
    > Opera can understand this:
    > document.forms[0].goto.value=x;
    > and Mozilla can't. W3C validator also doesn't make errors on it. Stupid
    > mozilla- I lost few hours to find this out :p


    You must have serious problems with your pages if you have to omit
    standard HTML tags to save a few bytes. :)

    As allready is said, W3C doesn't have a Javascript validator. So you
    may consult the Javascript Consol in Mozilla to see what it says about
    the scripts you have.

    --
    /Arne
    Now killing all top posters and posters who don't quote
    * How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
    * From Google: http://www.safalra.com/special/googlegroupsreply/
    -------------------------------------------------------------
    Arne, Oct 15, 2005
    #7
  8. Guest

    Guest Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    "Arne" <>
    > You must have serious problems with your pages if you have to omit
    > standard HTML tags to save a few bytes. :)

    My pages are very small- usually 2-3 kB of code :]

    > As allready is said, W3C doesn't have a Javascript validator. So you
    > may consult the Javascript Consol in Mozilla to see what it says about
    > the scripts you have.


    But it doesn't say it is reserved word, and it is not reserved in Opera and
    MSIE. MSIE has invented JavaScript, not Mozilla.

    Regards,
    Talthen
    Guest, Oct 16, 2005
    #8
  9. Guest

    Guest Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    "Jonathan N. Little" <>
    > No your problem is 'goto' is a JavaScript reserve word!!!
    >
    > JavaScript Reserve Words:
    >
    > abstract, boolean, break, byte, case, catch, char, class, const, continue,
    > debugger, default, delete, do, double, else, enum, export, extends, false,
    > final, finally, float, for, function, goto, if, implements, import, in,
    > instanceof, int, interface, long, native, new, null, package, private,
    > protected, public, return, short, static, super, switch, synchronized,
    > this, throw, throws, transient, true, try, typeof, var, void, volatile,
    > while, with


    Thanks for the list :]
    However goto is a function and I have goto as a variable. For MSIE and Opera
    it makes the difference and MSIE is the inventor of JavaScript.

    Regards,
    Talthen
    Guest, Oct 16, 2005
    #9
  10. Re: Why this code is invalid? [+stupid=mozilla :p ]

    On Sun, 16 Oct 2005, wrote:

    > MSIE has invented JavaScript,


    Boggle.
    Alan J. Flavell, Oct 16, 2005
    #10
  11. Re: Why this code is invalid? [+stupid=mozilla :p ]

    On 16/10/2005 12:09, wrote:

    [snip]

    > However goto is a function and I have goto as a variable.


    Then change those identifiers.

    > [...] MSIE is the inventor of JavaScript.


    Netscape invented JavaScript, and Microsoft /later/ implemented a
    similar language named JScript. Both have now been standardised as
    ECMAScript by ECMA International, and it is this language that browser
    vendors aim to implement.

    In JScript, there are future reserved words, and this includes goto. The
    difference is that JScript doesn't enforce this list (though it should).
    However, even Microsoft states that these words should not be used as
    identifiers.

    Mike

    --
    Michael Winter
    Prefix subject with [News] before replying by e-mail.
    Michael Winter, Oct 16, 2005
    #11
  12. Guest

    Arne Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    Once upon a time ** wrote:

    > "Arne" <>
    >> You must have serious problems with your pages if you have to omit
    >> standard HTML tags to save a few bytes. :)

    > My pages are very small- usually 2-3 kB of code :]
    >
    >> As allready is said, W3C doesn't have a Javascript validator. So you
    >> may consult the Javascript Consol in Mozilla to see what it says about
    >> the scripts you have.

    >
    > But it doesn't say it is reserved word, and it is not reserved in Opera and
    > MSIE. MSIE has invented JavaScript, not Mozilla.
    >


    But at the moment JavaScript suffers from outdated, uninformed, and
    inaccessible development methods, supported by the likewise outdated
    IE browser. The WaSP DOM Scripting Task Force proposes to solve this
    problem by the adoption of unobtrusive DOM scripting, a way of
    thinking based on modern, standards-compliant, accessible web
    development best practices.

    The only way the earlier Netscape versions could get users was to
    support the "inventions" from MSIE as good as they could. Opera
    probably feel they must do the same in order to draw user to their
    browser, at least for the moment.

    IE has from the start made a distinct point of being as incompatible
    as possible, and gleefully ignored standards such as W3C
    recommendations. This still influences the way JavaScript is used,
    especially by people who don’t work with it on a regular basis.

    Solving these psychological problems requires a new way of thinking
    that is more in line with modern, standards-compliant web development
    practices. Still, accessibility efforts are too often limited to
    saying "Sorry" to users of the wrong browser. Unobtrusive thinking
    help to solve this problem.

    --
    /Arne
    Now killing all top posters and posters who don't quote
    * How to post: http://www.cs.tut.fi/~jkorpela/usenet/brox.html
    * From Google: http://www.safalra.com/special/googlegroupsreply/
    -------------------------------------------------------------
    Arne, Oct 16, 2005
    #12
  13. Leif K-Brooks, Oct 16, 2005
    #13
  14. Re: Why this code is invalid? [+stupid=mozilla :p ]

    wrote:
    > "Jonathan N. Little" <>
    >
    >>No your problem is 'goto' is a JavaScript reserve word!!!
    >>
    >>JavaScript Reserve Words:
    >>
    >>abstract, boolean, break, byte, case, catch, char, class, const, continue,
    >>debugger, default, delete, do, double, else, enum, export, extends, false,
    >>final, finally, float, for, function, goto, if, implements, import, in,
    >>instanceof, int, interface, long, native, new, null, package, private,
    >>protected, public, return, short, static, super, switch, synchronized,
    >>this, throw, throws, transient, true, try, typeof, var, void, volatile,
    >>while, with

    >
    >
    > Thanks for the list :]
    > However goto is a function and I have goto as a variable. For MSIE and Opera
    > it makes the difference and MSIE is the inventor of JavaScript.


    Please lookup the meaning of a 'reserve word' in any computer
    language...it means that they cannot be use as intentifiers--'cuz their
    reserved! That is way the script I wrote changing the name of the input
    field from 'goto' to 'notgoto' works!

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Oct 16, 2005
    #14
  15. Guest

    Toby Inkster Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    talthen.z-serwera.o2 wrote:

    > MSIE has invented JavaScript, not Mozilla.


    Other way around.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Oct 16, 2005
    #15
  16. Guest

    Guest Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    "Alan J. Flavell" <>
    >> MSIE has invented JavaScript,


    Yeah, sorry ;/ Either I read a stupid article or I just did a mistake. MSIE
    invented JScript.

    Regards,
    Talthen
    Guest, Oct 16, 2005
    #16
  17. Re: Why this code is invalid? [+stupid=mozilla :p ]

    On Sun, 16 Oct 2005, wrote:

    > "Alan J. Flavell" <>
    > >> MSIE has invented JavaScript,


    Please take more care over your quoting! Casual readers of your
    followup might assume that it was me who made that incorrect
    statement.

    > Yeah, sorry ;/


    I hope so!

    thanks
    Alan J. Flavell, Oct 16, 2005
    #17
  18. Guest

    Spartanicus Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    <> wrote:

    >MSIE invented JScript.


    Invent: To design something for the first time.

    Microsoft attempted to *copy* Netscape's Javascript by reverse
    engineering it (and as you'd expect getting it wrong in places). They
    named it Jscript because Netscape had trademarked the name Javascript.

    --
    Spartanicus
    Spartanicus, Oct 16, 2005
    #18
  19. Guest

    JDS Guest

    JDS, Oct 16, 2005
    #19
  20. Guest

    Neredbojias Guest

    Re: Why this code is invalid? [+stupid=mozilla :p ]

    With neither quill nor qualm, Alan J. Flavell quothed:

    >
    > On Sun, 16 Oct 2005, wrote:
    >
    > > "Alan J. Flavell" <>
    > > >> MSIE has invented JavaScript,

    >
    > Please take more care over your quoting! Casual readers of your
    > followup might assume that it was me who made that incorrect
    > statement.


    Ah, don't worry. The non-casual reader takes pains to identify your
    mistakes and attribute them correctly.

    >
    > > Yeah, sorry ;/

    >
    > I hope so!
    >
    > thanks
    >


    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Oct 16, 2005
    #20
    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. Patrick.O.Ige
    Replies:
    1
    Views:
    1,940
    Patrick.O.Ige
    Jul 2, 2006
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    855
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,756
    Smokey Grindel
    Dec 2, 2006
  4. Java Guy
    Replies:
    1
    Views:
    667
    Manish Pandit
    Oct 15, 2006
  5. kevin
    Replies:
    0
    Views:
    955
    kevin
    Jan 16, 2008
Loading...

Share This Page