Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7158477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:04:21+00:00 2026-05-28T13:04:21+00:00

I was wondering what will happen if I run this code: <!DOCTYPE html> <html

  • 0

I was wondering what will happen if I run this code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>MimeType Tester</title>
    <meta charset="utf-8" />
    <meta content="text/xml; charset=utf-8" http-equiv="content-type" />
    <meta content="text/html; charset=utf-8" http-equiv="content-type" />
</head>
<body>
</body>
</html>

My content will be parsed as XML or HTML? Both? Other?

Also I have a JS code that sets mimetype twice:

req = new XMLHttpRequest();
req.overrideMimeType('text/xml');
req.overrideMimeType('text/html');

My content will be parsed as XML or HTML? Both? Other?

Is there a diffrent between both codes?
Is the result the same?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:04:23+00:00Added an answer on May 28, 2026 at 1:04 pm

    Taking the HTML first. Unless the server interprets the meta http-equiv=content-type setting and converts it to a real HTTP header (which HTML4 says is the purpose of meta http-equiv, but servers almost never do) then the HTTP content-type is not affected, and it is that, not the meta http-equiv setting (or the doctype) that determines whether the HTML or XML parser is invoked.

    So that normally means that the HTML parser will be invoked, but configuration or application code external to your question may cause the browser to process it differently. (As XML, or plain text, or binary data or something else)

    As for the JS, I don’t know and haven’t tested it, but can think of no reason why the second overrideMimeType call wouldn’t replace the setting of the first call, and the request would go out with a content-type of text/html. This seems to be the effect of the requirements of the spec here : http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-overridemimetype%28%29-method but it doesn’t explicitly cover this case.

    How the server interprets the mime type and content sent from the browser is entirely down to the code running on the server. It may take the mime type into account to select a parser, it may ignore it, or do something entirely contrary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if this kind of thing will ever be possible in PHP (and
I was wondering what will happen if I make 2 ajax calls one after
After using my android phone for a while, it will run into this problem
I'm using Visual Studio 2005 and I'm wondering what will happen if I rename
From http://pubs.opengroup.org/onlinepubs/009604599/functions/pipe.html : The pipe() function shall create a pipe and place two file
I'am wondering what will happen if my App which was previously available on the
I'm wondering what will happen after 2038-01-19 03:14:07 with table fields using TIMESTAMP as
Wondering if following will work for google in robots.txt Disallow: /*.action I need to
I'm wondering whether I will ever get a different result when producing a checksum
Wondering if anyone can suggest a good file replication tool that will replicate across

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.