开发者

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

开发者 https://www.devze.com 2022-12-26 04:34 出处:网络
Given the following lines of code which is using JQTOUCH: $(\'#customers\').bind(\'pageAnimationEnd\', function(e, info){

Given the following lines of code which is using 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.

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'});
            });
0

精彩评论

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