开发者

jQuery Ajax request returning null in Internet Explorer only

开发者 https://www.devze.com 2023-01-11 11:21 出处:网络
I\'m trying to GET an HTML document using the jQuery ajax() method. When I try and parse the returned data using $(data) all browsers other than Internet Explorer are returning a DOM element, wh

I'm trying to GET an HTML document using the jQuery ajax() method.

When I try and parse the returned data using $(data) all browsers other than Internet Explorer are returning a DOM element, whereas Internet Explorer is returning NULL.

I've checked 'data' and it's a string as expected.

What might cause this? I'm guessing it could be errors in the markup being pulled in, but I can't spot anything in the validation?

I'm using jQuery 1.4.2.

jQuery.ajax({
    url: url,
    cache: fa开发者_运维问答lse,
    contentType: 'html',
    processData: false,
    success: function(data) {
        console.log($(data));
    }
});


Be sure that your URL variable don't link to the XHTML page. Otherwise there are many problems with Internet Explorer.

0

精彩评论

暂无评论...
验证码 换一张
取 消