jqery的Ajax之beforeSend和complete 方法

1.

$.ajax({ 
    type: "post",
     contentType: "application/json",
     url: "/Home/GetList", 
    beforeSend: function () 
    { 
        $("loading").show(); 
    }, 
    success: function (data) { 
        if (data == "Success") { 
        // ... 
        } 
    }, 
    complete: function () {
         $("loading").hide(); 
    },
     error: function (data) {
         console.info("error: " + data.responseText); 
    } 
});

猜你喜欢

转载自blog.csdn.net/milli236/article/details/84062332