jQuery AJAX GET html data IE8 not working

≡放荡痞女 提交于 2019-12-24 11:51:45

问题


This is the code but it's not working on IE8 & 7 (IE9 , chrome,firefox, safari,opera are all ok). I have tried a lot of things (meta utf-8 code, php header code, taking alerts, cache:false).What can i do , i need help. Thanks for your interests.

        var request = $.ajax({
          type:"GET",
          url: "_veri.php?t=icerik_getir&id="+tabopen,
          dataType: "html",
        });
        request.done(function(msg) {
            $(".tab-contentmenu").html(msg);
        });

EDIT:

alert gives me the data of requested in all browsers but still no requested data in ".tab-contentmenu" , what should i do?

            var request = $.ajax({
            type:"GET",
            context: document.body,
            url: "_veri.php?t=icerik_getir&id="+tabopen,
            dataType: "html"
            });
            request.done(function(msg) {
              $(".tab-contentmenu").html(msg);
              alert(msg);
            });

回答1:


I solved the problem , in php file there was a unclosed div and I removed it.




回答2:


IE can get indigestion from syntax errors in js. Try removing the unnecessary comma:

var request = $.ajax({
      type:"GET",
      url: "_veri.php?t=icerik_getir&id="+tabopen,
      dataType: "html" //removed the comma here
    });



回答3:


Try this:

        $.ajax({
            url: "_veri.php?t=icerik_getir&id="+tabopen,
            success: function(data){
                $(".tab-contentmenu").html(data);
            }
        });


来源:https://stackoverflow.com/questions/8792815/jquery-ajax-get-html-data-ie8-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!