Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Validation error when embedding Google Map

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25725
    jchap59
    Participant

    Hi,

    Trying to embed a google map into a web site and keep getting a validation error from the W3C checker

    Line 64, Column 50: document type does not allow element "body" here

    <body onload="initialize()" onunload="GUnload()"/>

    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements — such as a "style" element in the "body" section instead of inside "head" — or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML’s rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML’s "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

    I think I have follwed the Google instructions and the problem is certainly with the position of the ‘onload’ statement at line 64. HTML code below

    Code:
    1.
    3.
    4.
    5.
    6.
    7. Google Maps JavaScript API Example
    8. 9.
    11.
    26.

    38.
    39.

    44.
    45.
    46.

    47.

    51.

    62.

    63.

    64.
    65.

    66.

    67.

    68.

    69.

    71.

    72.
    73.
    74.
    75.

    Probably my lack of experience – any help to resolve gratefully accpeted (web page works OK ?)

    John C

    #62375
    jchap59
    Participant

    Greg,

    Thanks for the reply – yes, conflict was in having 2 body entries – have moved the onload statement up to the top body entry and it now validates.

    Thanks for your help

    John C

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.