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 4260224
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:53:29+00:00 2026-05-21T05:53:29+00:00

So here’s something I find puzzling. I’m working on a Javascript that needs to

  • 0

So here’s something I find puzzling.

I’m working on a Javascript that needs to parse XML data and I’m using jQuery’s $.ajax to fetch and parse the data. It’s working great everywhere except when I test with Internet Explorer 8 (it might be a problem on 7 and 9 too). On IE, I’m getting parse errors. I installed a console.log to check the HTTP headers. Here’s what I get from Chrome on Windows XP and what I’m getting from IE —

Chrome:

Date: Sat, 09 Apr 2011 16:06:24 GMT
Connection: Keep-Alive
Content-Length: 2283
Last-Modified: Sat, 09 Apr 2011 15:59:12 GMT
Server: Apache/2.2.14 (Ubuntu)
ETag: "48048-8eb-4a07e6c693400"
Content-Type: application/xml
Accept-Ranges: bytes
Keep-Alive: timeout=15, max=97

IE8:

LOG: ETag: "48048-8eb-4a07d7a3cbe40"
Keep-Alive: timeout=15, max=97
Content-Type: text/html
Content-Length: 2283
Last-Modified: Sat, 09 Apr 2011 14:51:29 GMT

This is what the xml document looks like:

<?xml version="1.0" encoding="UTF-8"?>
<root>
    <tweet>
        <name>name</name>
        <message>message</message>
        <avatar>avatar</avatar>
    </tweet>
    <tweet>
        <name>name</name>
        <message>message</message>
        <avatar>avatar</avatar>
    </tweet>
</root>

I checked the MIME configuring for my Apache server and it is set to send xml files as ‘application/xml’. So it’s strangely sending a content-type of ‘application/xml’ to Chrome, but IE gets content-type of ‘text/html’.

So I built a simple PHP script:

<?php
header('Content-type: application/xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
?>
<root>
    <tweet>
        <name>name</name>
        <message>message</message>
        <avatar>avatar</avatar>
    </tweet>
    <tweet>
        <name>name</name>
        <message>message</message>
        <avatar>avatar</avatar>
    </tweet>
</root>

When I change the Javascript to retrieve the PHP instead of the XML file, I get these response headers —

Chrome with PHP:

Date: Sat, 09 Apr 2011 16:10:39 GMT
X-Powered-By: PHP/5.2.10-2ubuntu6.7
Connection: Keep-Alive
Content-Length: 2102
Server: Apache/2.2.14 (Ubuntu)
Content-Type: application/xml; charset=UTF-8
Keep-Alive: timeout=15, max=97

IE with PHP:

LOG: X-Powered-By: PHP/5.2.10-2ubuntu6.7
Content-Length: 2102
Keep-Alive: timeout=15, max=100
Content-Type: application/xml; charset=UTF-8

So from what I can tell, with my limited Apache knowledge, it seems like the raw XML file is getting sent without the right content-type only to IE, even though I have it configured to send ‘application/xml’. Chrome is receiving the right content-type. When I use PHP, Apache seems to be following my wishes and sending ‘application/xml’ because that is what I stamped it as in the script. Is it also strange that IE doesn’t have all the same headers as Chrome? “Server” is missing for instance.

So what could possibly be getting in the way and changing ‘application/xml’ to ‘text/html’ only for Internet Explorer? I’d hate to have to rely on a PHP script to output my XML data. I thought of mod-deflate, but I disabled it and the results are the same.

Any ideas?

(PS – the XML I’m including is just a sample, so the content-lengths don’t match up)

  • 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-21T05:53:30+00:00Added an answer on May 21, 2026 at 5:53 am

    So I think I figured it out.

    It appears that IE caches the AJAX GET data in such a way that it is hard (impossible?) to clear it out. Maybe I had the xml configured as text/xml at some point, but I don’t think so. Basically, IE continued to use the cached results for that XML file over the actual server results. That also explains why the HTTP headers looked so odd (no server information for instance). Or it’s possible that the cache is always producing text/html (I gave up further tests).

    My solution:
    I added a ‘?avoidcache=’ + a timestamp to the end of the URL in the GET request. Now IE gets the proper HTTP headers that I set on the server.

    Wow do I hate Internet Explorer. How many development hours are wasted creating workarounds for it’s horrible behavior?

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

Sidebar

Related Questions

Here is the issue I am having: I have a large query that needs
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's my scenario - I have an SSIS job that depends on another prior
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm getting an error here that says I haven't defined a method, but it
This is beyond both making sense and my control. That being said here is
Here's a problem I ran into recently. I have attributes strings of the form
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote

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.