开发者

ie not firing ajax complete call on certain page

开发者 https://www.devze.com 2022-12-30 07:06 出处:网络
even with a piece of code like this $.get(\'getforums.php\', function(data) { alert(data); }); works well in chrome, firefox, safari, opera but not this baby.

even with a piece of code like this

$.get('getforums.php', function(data) {
    alert(data);
});

works well in chrome, firefox, safari, opera but not this baby. tried everything, cleared cache, recreate this file in different editor, even make this file just开发者_JAVA技巧 echoed a 's', but no, it just don't like this file, works perfect on other file

thanks for the help!


Most likely an encoding issue. IE is pretty strict about what encodings it will accept. Try switch the $.get out for a $.ajax call and log the error message.

$.ajax({
  url: 'getforums.php',
  dataType: 'text',
  data: {},
  success: function(data) {
    console.log(data);
  },
  error: function(XMLHttpRequest, textStatus, errorThrown) {
    console.log(textStatus, errorThrown);
  }
});
0

精彩评论

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