Home > Web Front-end > JS Tutorial > body text

Solution to jquery .ajax stuck problem in IE_jquery

WBOY
Release: 2016-05-16 18:43:11
Original
1141 people have browsed it

The first step to solve the IE encoding problem:
dataType:($.browser.msie) ? "text" : "xml" Do this first to let IE identify whether the returned text or xml is
The second step:

Copy code The code is as follows:

function parseXml(xml) { //Second step of XML IE encoding problem
if (jQuery.browser.msie) { // Determine whether the browser is IE
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); //The xmldom object under Microsoft
xmlDoc.loadXML( xml);
xml = xmlDoc;
}
return xml;
}

Step 3:
Copy code The code is as follows:

function getText(xml)
{ var newXML=parseXml(xml);
var sp=$( "#special");
var manage=$("#manageContent");
var common=$("#common");
. . . . . Omitted
}

has been applied in the project being done, so it is recommended. .
Why does it appear to be invalidated in IE? From the above solution, we can know that it is an encoding problem of the XML file. When the conversion meeting is readable in the frontend, it does not conform to the XML object of IE, so it needs to be translated into an IE-compatible object.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template