XML error on Chrome but is fine on FF?

Asked
Active3 hr before
Viewed126 times

5 Answers

error
90%

Meta Stack Overflow , Stack Overflow Public questions & answers , Stack Overflow help chat ,Thanks for contributing an answer to Stack Overflow!

This works on Firefox but not chrome:

getData.php ? id = 1744225 & odds = 1
load more v
88%

Your server is not returning a content-type, so Firefox assumes that since this is _XML_HttpRequest your response might be XML and tries to parse it. When that fails, it stops trying and reports that this wasn't XML after all.,Just Add this code. The problem is the server did not specify the mime type and firefox takes it to be xml. This code will specify what Mime type the xhr response is going to be.,I suggest actually sending a Content-Type header indicating what your data is.

Just Add this code. The problem is the server did not specify the mime type and firefox takes it to be xml. This code will specify what Mime type the xhr response is going to be.

beforeSend: function(xhr) {
   xhr.overrideMimeType("text/plain; charset=x-user-defined");
},
72%

I'm running CKFinder 2.3 (with a license) with PHP 5.3.2 on Ubuntu Lucid and I'm getting an XML error on load. I would normally suspect a server-side problem, but it works in some browsers but not others. It works fine in Safari (Mac & Win), IE, and Opera, but Chrome (22) and Firefox (15) give an error when loading the top level folder (the default view), and occasionally (but not always) when fetching the folder list:,To manage your existing license subscriptions and products, please log in to the dashboard.

I'm running CKFinder 2.3 (with a license) with PHP 5.3.2 on Ubuntu Lucid and I'm getting an XML error on load. I would normally suspect a server-side problem, but it works in some browsers but not others. It works fine in Safari (Mac & Win), IE, and Opera, but Chrome (22) and Firefox (15) give an error when loading the top level folder (the default view), and occasionally (but not always) when fetching the folder list:

It was not possible to load the XML response from the web server.The server returned an empty response.
XML Parsing Error: no element found Location: https: //www.example.net/ckfinder/ckfinder.html?action=js&func=ShowFileInfo&dts=1&id=ckf1 Line Number 1, Column 1

Using debug tools, I can see that the requests are identical (obviously different ones for GetFolders, GetFiles and ShowFileInfo) across browsers, but the responses vary.

Requests are to places like:

https: //www.example.net/ckfinder/core/connector/php/connector.php?command=GetFiles&type=Images&currentFolder=%2F&langCode=en&hash=3e9be1890d76ce67&id=ckf1
load more v
65%

So, the following HTTP response is OK for Chrome, but IE shows a blank page:,Chrome does it fine, but IE 11 simply shows a blank page.,But the following does work under both IE and Chrome:,If the XML file is valid then most browsers (IE8, Chrome and Firefox) give a message like This XML file does not appear to have any style information associated with it. The document tree is shown below. and go into a special mode for showing XML files with features like being able to collapse code blocks.

So, the following HTTP response is OK for Chrome, but IE shows a blank page:

HTTP/1.1 200 OK
Cache-Control: private, s-maxage=0
Content-Type: application/xml
Server: Microsoft-IIS/8.0
Date: Fri, 25 Jul 2014 14:29:02 GMT
Content-Length: 693

<?xml version="1.0" encoding="utf-16"?><data>...</data>

But the following does work under both IE and Chrome:

HTTP/1.1 200 OK
Cache-Control: private, s-maxage=0
Content-Type: application/xml; charset=utf-8
Server: Microsoft-IIS/8.0
Date: Fri, 25 Jul 2014 14:29:02 GMT
Content-Length: 693

<?xml version="1.0" encoding="utf-16"?><data>...</data>

For ASP.NET MVC developers, this means that if you want to render raw XML and support IE, you cannot use:

string xmldata = ...
   return this.File(Encoding.UTF8.GetBytes(xmldata), "application/xml");

Instead, the following works:

string xmldata = ...
   Response.ContentType = "application/xml";
Response.ContentEncoding = Encoding.UTF8;
Response.AddHeader("Content-Length", Convert.ToString(xmldata.Length));
return this.Content(xmldata);
load more v
75%

Can anyone help please…the following xml sitemap i have created for my website…its working fine in Internet Explorer…but having issues in firefox and chrome…,Can anyone please help whats the issue…where i am wrong…there are more than 3500 urls in my sitemap.,And please put any code you post between the appropriate tags. It makes it easer to read, and prevents strange smilies from popping up in the middle of it ,Powered by Discourse, best viewed with JavaScript enabled

Can anyone help please…the following xml sitemap i have created for my website…its working fine in Internet Explorer…but having issues in firefox and chrome…

<?xml version="1.0" encoding="UTF-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
   <url>
      <loc>http://www.aa.com/</loc>
      <priority>0.5</priority>
      <changefreq>daily</changefreq>
   </url>

Other "error-undefined" queries related to "XML error on Chrome but is fine on FF?"