简体   繁体   English

给出以下代码,如何摆脱JQUERY APPEND

[英]How to get rid of a JQUERY APPEND GIve the following code

Given the following lines of code which is using JQTOUCH: 给定以下使用JQTOUCH的代码行:

$('#customers').bind('pageAnimationEnd', function(e, info){
    if (!$(this).data('loaded')) {                     
        $('.loadingscreen').css({'display':'block'});
        $(this).append($('<div> </div>').        
            load('/mobile/ajax/customers/ .info', function() {        
                $(this).parent().data('loaded', true); 
                $('.loadingscreen').css({'display':'none'});
            }));
    }
});

How can I get ride of the .append($(' '). It used to be append($('loading') but I didn't need that and now it seems like a waste of processing time to have in the function. 我怎样才能骑上.append($('')。它曾经是append($('loading'),但我并不需要它,现在似乎在函数中浪费处理时间。

Is it possible? 可能吗?

 $(this).append($('<div> </div>').        
            load('/mobile/ajax/customers/ .info', function() {        
                $(this).parent().data('loaded', true); 
                $('.loadingscreen').css({'display':'none'});
            }));

becomes 变成

 $(this).load('/mobile/ajax/customers/ .info', function() {        
                $(this).parent().data('loaded', true); 
                $('.loadingscreen').css({'display':'none'});
            });

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

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