0

我试图在 ajax 完成事件中执行一些代码,但它不适用于页面加载事件,但它在 onchange 链接事件中完美运行

$(document).ready(function() {
    $.ajax({
        beforeSend: function() {
         // Handle the beforeSend event
        },
        complete: function() {
            // Handle the complete event
            $("#customfields_1 :input").filter(function() {
                return $.trim(this.value).length === 0;
            }).closest("td").hide();
        }
       // ......
    });
});
4

1 回答 1

0
$(document).ready(function() {
    $.ajax({
        url: 'http://foo.bar.com/some.json',  // this is the important part
        beforeSend: function() {
         // Handle the beforeSend event
        },
        complete: function() {
            // Handle the complete event
            $("#customfields_1 :input").filter(function() {
                return $.trim(this.value).length === 0;
            }).closest("td").hide();
        }
       // ......
    });
});
于 2013-02-16T06:05:14.980 回答