开发者

jquery ajaxStart / Complete trigger other procedure

I have three ajaxStart procedure in same page. First: main, and second is opened in mainand third is opened in second. So i use live function. There is no problem here.

Here are my codes:

Second procedure:

$('#filmadres').live('click',function(event){
event开发者_如何学编程.preventDefault();

    $.ajax({
//procedure

        success: function(ajaxCevap) {
            $('#filminfo').html(ajaxCevap);
            $('#filminfo').show();
        }
});

    $('#filminfo').bind('ajaxStart',function(){

        $('#filmlist').unbind('ajaxStart');
        $('#loading2').html('<img src="harici/ajax-fb-loader.gif" />');
        $('#loading2').show();

    });

    $('#filminfo').bind('ajaxComplete',function(){

        $('#filmlist').unbind('ajaxStop');
        $('#loading2').hide();
        $('#filminfo').show(1000);

    });

and this is third procedure:

$('#postercek').live('click',function(event){
        event.preventDefault();

$.ajax({
//procedure

    success: function(ajaxReply) {
                $('#posterbilgisi').html(ajaxReply);
            }

        });

$('#posterbilgisi').bind('ajaxStart',function(){

    $('#filminfo').unbind('ajaxStart');
    $('#posterloading').html('<img src="harici/ajax-fb-loader.gif" />');
    $('#loading2').css('display','none');
    $('#posterloading').css('display','block');

}); 

$('#posterbilgisi').bind('ajaxComplete',function(){

    $('#filminfo').unbind('ajaxComplete');
    $('#posterloading').css('display','none');

}); 

And the problem:

Second ajaxStart/Complete function is not working. When i click #postercek, first function is working (filminfo ajaxStart). But result is true, it displays $('#posterbilgisi').html(ajaxReply); . There is mistake only in "loading" procedures. What must I do?

Where am i making mistake? Im so confused...


The question is not very clear.

The first code snippet is attempting to bind a function to an "ajaxStart" event of the filminfo element - ajaxStart is not a standard event

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜