Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML1514: Extra "<body>" tag found

I'm using the IE 11 (version 11.0.9431.0), to test our current website and see how it would work when IE 11 will be released with Windows 8.1 mid-October. What I see on almost all pages is the following message:

HTML1514: Extra "<body>" tag found. Only one "<body>" tag should exist per document.

When I look through the source code, there is no second <body> anywhere. Is this a IE 11 bug? Is this something I should take seriously? The pages work fine btw...

Thanks.

EDIT:

I don't have access to that website anymore, therefore I can't try any new solutions you guys are posting.

like image 284
Adrian Avatar asked Oct 01 '13 13:10

Adrian


People also ask

What is an body tag?

Definition and Usage. The <body> tag defines the document's body. The <body> element contains all the contents of an HTML document, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

Where is the body tag located?

The HTML <body> element is found within the <html> tag.

Why is the body tag important?

The Body tag is an important element that contains all the content displayed on a web page in a browser. It must be filled in correctly in order for the page to look and be successfully ranked in search engines.

Can body tag is replaced with body tag?

You can only replace the HTML's body element with PHP if you are outputting the HTML with PHP (changing it before outputting it).


3 Answers

If you placed some element (that should appear only inside body) before the <body> tag, the <body> is inserted automatically by the parser (the "Anything else" paragraph) - and this is still valid HTML because body has optional both opening and closing tags. That would mean that the actual <body> is the second one the parser sees. Couldn't this be your case?

like image 147
duri Avatar answered Oct 11 '22 18:10

duri


My guess is you probably have if IE statements, something like:

<!--[if IE 9]>     <body class="ie ie9 lte9"> <![endif]-->

They don't actually work in IE10, let alone IE11 so that's why you'd be getting the extra tag found.

like image 43
mattytommo Avatar answered Oct 11 '22 17:10

mattytommo


The problem (which is present in IE 10, too) is caused by the element

<script type="text/javascript" src="/_clients/binck_nl/data/js/analytics.js?nl_1377516473" ></script>

It probably modifies the DOM so that IE gets confused.

like image 26
Jukka K. Korpela Avatar answered Oct 11 '22 16:10

Jukka K. Korpela