Skip to content

Ajax breaks on IE8 if "Enable native XMLHTTP support" checkbox is uncheked #295

Closed
IngusSkaistkalns opened this Issue Dec 8, 2012 · 0 comments

2 participants

@IngusSkaistkalns

In Internet Explorer 8 you can uncheck "Enable native XMLHTTP support" under Tools > Internet Options > Advanced. More info about this "special" feature -> http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx

This breaks down something UJS ajax, but jQuery.ajax still works as usual (so this is why i made assumption that problem is under UJS scope).

Code for scenario:

Views:

<%= link_to "With UJS", ujs_test_path, class: "ujs", data: { remote: true, type: "text"} %>
<%= link_to "Without UJS", ujs_test_path, class: "simple" %>

Controller:

def ujs_test
  respond_to do |format|
    format.text { render text: "Ajax works as expected!"}
  end
end

Javascript:

$(document).ready(function(){
  $("a.ujs").live("ajax:success", function(e, data){
    alert(data);
  });

  $("a.simple").live("click", function(e){
    e.preventDefault();
    $.ajax({
      url: $(this).attr("href"),
      type: "GET",
      dataType: "text",
      success: function(data){
        alert(data);
      }
    })
  });
})

I didn't test this on IE7, but I have strong feeling there is the same issue, because i tested it on IE9 in three modes - IE7 mode (problem is present), IE8 mode (problem is present), IE9 mode (problem is not present).

I also tried to get some more information, so added this:

  $("a.ujs").live("ajax:error", function(jqXHR, status, errorThrown){
    window.myXHR = jqXHR;
    window.status = status;
    window.errorThrown = errorThrown;
    alert(errorThrown);
  });

On IE9 developer tools you can actually add objects to watch and you can inspect them, so under window.status property statusText value is "TypeError: Object doesn\'t support this property or method"

Thats where my investigation ends.

@ebeigarts ebeigarts referenced this issue in jquery/jquery Jan 3, 2013
Closed

Fix for #11645 #751

@jarodtaylor jarodtaylor referenced this issue in rails/jquery-rails Jan 14, 2013
Closed

UJS Update ETA? #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.