繁体   English   中英

jQuery ajax complete事件后未执行代码

[英]Code is not executed after the jquery ajax complete event

我试图在ajax complete事件中执行一些代码,但是在页面加载事件中不起作用,但是在onchange link事件中它可以正常工作

$(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();
        }
       // ......
    });
});
$(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();
        }
       // ......
    });
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM