Bug Tracker

Modify

Ticket #7047 (closed bug: worksforme)

Opened 3 years ago

Last modified 14 months ago

ie7/8 ajax bug with html content type

Reported by: doccoder Owned by:
Priority: Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: ajax,html,ie7,ie8 Cc:
Blocking: Blocked by:

Description

Provided by Tim Nichols: This happens on both IE7 and IE8 - if you make an ajax call and use html as your content type, the call fails. (text, json, and others work fine). It does not happen on IE6 or FF.

Work arounds: Option 1- return text instead of html, then use:

success: function(data) {

xhr = (new DOMParser()).parseFromString(data, ‘text/html’);

… }

Option 2- overload the jQuery.ajaxSetup() function.

IE 7/8 fix for html ajax calls... jQuery.ajaxSetup({ xhr:function() {

try {

if (window.ActiveXObject)

return new window.ActiveXObject("Microsoft.XMLHTTP");

} catch(e) {} return new window.XMLHttpRequest(); }

});

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

There's no test case, but in general the HTML data type works. If DOMParser works and injection via innerHTML (in $.ajax) does not, then most likely IE doesn't like the HTML because it has validity problems.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.