Luci
Luci

Reputation: 3264

Weird things happens when upgrading from jquery 1.3.2 to 1.9.1

I made a work around as below but i don't like it. I would like to understand why it happened.I'm also afraid to have more problems like that.

 $.ajax({
    type: "POST",
    url: "test.cgi",
    data: form_data,
    beforeSend: function(){
        $("#"+type+"_div").html("<span class='LabelRed12'>Loading , please wait..</span><br/>");
    },
    complete: function(){

    },
    success: function(html){
        $("#"+type +"_div").html(html);

    },
    error:function(xhr,err){
         if (xhr.readyState == 4) {
           if (xhr.status == 200) {
                $("#"+type +"_div").html(xhr.responseText);
           } else
             alert("status is " + request.status);
         }
    }
    });

Upvotes: 1

Views: 691

Answers (2)

asifsid88
asifsid88

Reputation: 4701

you should use jquery migrate plugin when you move from lover version to higher version. Check the jquery site and get the migrate jquery api. This will solve your issue

Refer : jquery.com/download/

Upvotes: 1

Philippe Boissonneault
Philippe Boissonneault

Reputation: 3949

You problem might be that you don't specify dataType for your ajax request, try adding this :

dataType: 'json'

Upvotes: 1

Related Questions