1

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);
            });
İlker Korkut
  • 3,129
  • 3
  • 30
  • 51

3 Answers3

5

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

İlker Korkut
  • 3,129
  • 3
  • 30
  • 51
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
    });
jk.
  • 14,365
  • 4
  • 43
  • 58
  • @user1136403 If the element you are targeting is not valid HTML (opening and closing tags) or it is HTML 5, it may fail in IE. – jk. Jan 09 '12 at 18:15
  • no it's valid and not html5, on IE9 it's working but on ie8 & 7 not working. – İlker Korkut Jan 09 '12 at 18:18
  • request.done(function(msg) { $(".tab-contentmenu").html(msg); alert(msg); }); it takes the data html on alert but not shown on the page. – İlker Korkut Jan 09 '12 at 18:25
  • There is no problem in html i think , because its working on ie9 and other browsers also its working without ajax html codes in .tab-contentmenu area (this system is tab system and this ajax codes are under the click trigger event and also this codes are under the without click event default in default tab function so both of them are'nt working. – İlker Korkut Jan 09 '12 at 18:43
  • @user1136403 See http://stackoverflow.com/questions/412734/jquery-html-attribute-not-working-in-ie – jk. Jan 09 '12 at 18:47
  • in ie8 and 7 , no source code of data in html. but alert(msg); gives me html codes, i couldn't solve it... – İlker Korkut Jan 09 '12 at 18:58
1

Try this:

        $.ajax({
            url: "_veri.php?t=icerik_getir&id="+tabopen,
            success: function(data){
                $(".tab-contentmenu").html(data);
            }
        });
Luc Laverdure
  • 1,398
  • 2
  • 19
  • 36