Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Validation returns DOCTYPE error, and adds it's own html.

Participant ,
Sep 15, 2018 Sep 15, 2018

Copy link to clipboard

Copied

w3c validator (on text input) inserts <html lang=''><!DOCTYPE html> following the <!DOCTYPE html> that already exists in page source.

Also shows a non-existent </style> tag after </html> that is not in page source.

How is it that code appears as error when no such code exists in page source?

Error on Google Analytics expected as site source on a local server.

FF Dev shows no console errors aside from google code.

=====Actual page source======

<!DOCTYPE html>

<html lang-‘en’>

<head>

============Validation Results==================

  1. <!DOCTYPE html><html lang=''><!DOCTYPE html>↩
  2. <html lang=‘en'>
  3. <head>↩

====Validation also shows/creates </style> tag after </html>========

</body>↩

</html>↩

</style>

========Actual page source code as follows============

</body>

</html>

Views

694
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2018 Sep 15, 2018

Copy link to clipboard

Copied

Are you looking at source code on live server and validating with the online validation service?

The W3C Markup Validation Service

It's possible your web host is adding junk to the page without your knowledge.  GoDaddy has started this recently with their OPT OUT analytics tracking.

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 16, 2018 Sep 16, 2018

Copy link to clipboard

Copied

Thanks, Nancy.

As this was a single instance event, I rebuilt the page. It's likely I added a character space or some other inadvertent fumble of the fingers,

Thanks for your time.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 15, 2018 Sep 15, 2018

Copy link to clipboard

Copied

It is impossible to give you an accurate answer unless you post a link to your actual page... putting snippets of code in a forum post is rarely effective in permitting a proper analysis. Is your page available to view online?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 16, 2018 Sep 16, 2018

Copy link to clipboard

Copied

LATEST

Thanks for your response, Al.

Only posted a snippet in order to focus on my primary question: "How the extra code (which was not on page source) just appears in the validation result.

That really piqued my curiosity, but not enough to spend a lot of time on it. Easier to just rebuild a single page.

Thanks for your time.

w3c validator (on text input) inserts <html lang=''><!DOCTYPE html> following the <!DOCTYPE html> that already exists in page source.

Also shows a non-existent </style> tag after </html> that is not in page source.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines