2

i know this question had been asked b4 but none of the offered solutions seems to work for me. I have an ajax function that sends an id via post and pulls data accordingly. it works just fine in all browser but IE (all versions inc 9). no parse error or any other error shown. the code:

         $.ajax({
          url: "ajax.php",
      error:function(obj,err) {
        alert(err);
      },
      type:"POST",
      dataType:'json',
      data: "id=" + id,
      cache:false,
      success: function(data){
        console.log(data);
        var specs="<div class='float'>";
        for (i=0;i<data['specs'].length;i++) {
            specs+="<li>" + data['specs'][i] + "</li>";
            if ((i+1)%3==0) {
                specs+="</div><div class='float'>";
            };
        };
        specs+="</div>";
        $("#spec").find("ul").html(specs);
        $("#suite_thumbs ul").html(data['thumbs']);
        $("#large").attr("src","suites/suite" + data['id'] + "/pic1.jpg");
        $("#perks p").html(data['perks']);
        $("#suite_text p").html(data['desc']);
        $("#treatments p").html(data['treatments']);
        $("#arrival p").html(data['arrival']);
        $("#recommend p").html(data['recommend']);
        $("#suite_thumbs").find("img").click(function(){
    current.removeAttr("id");
    $(this).attr("id","current_thumb");
    current = $("#current_thumb");
    var src = $(this).attr("src"); 
    $("#large").attr("src",src);
});
num_pics = data['num_pics'];
video(data['id']); }
    });

your kind assitance would be most appreciated.

Matanya
  • 6,233
  • 9
  • 47
  • 80

1 Answers1

0
  1. Why did you put it in a success respond:

    $("#suite_thumbs").find("img").click(function(){ current.removeAttr("id"); $(this).attr("id","current_thumb"); current = $("#current_thumb"); var src = $(this).attr("src"); $("#large").attr("src",src); });

  2. Did you declare var *num_pics* and var video earlier?

Yevgen
  • 1,239
  • 3
  • 15
  • 30