0 0

谁能帮我把这段代码解释一下?5

谁能帮我把这段代码注释一下?就是每一行是什么意思?

当然有些太简单的就不用了!
<script>
    if(true){
        jQuery(function(){
           var m = window.location.search.match(/p=(\d+)/);
           var curPage = m ? parseInt(m[1]) : 1;
           var loading = false;

           jQuery("#content").scroll(function(){
               if ( curPage >= 1 && !loading && this.scrollHeight -
                       this.scrollTop - this.offsetHeight < this.offsetHeight ) {
                   loading = true;
                   if ((25*curPage) < 79729) {
                        DWRUtil.setValue("scrollStats", 25*(curPage+1) + " of " + 79729);
                    } else {
                        DWRUtil.setValue("scrollStats", 79729);
                    }
                   $("progressIndicator").style.display="block";
                   jQuery.ajax({
                       type: "GET",
                       dataType: "html",
                       url: window.location + (window.location.search != '' ? "&" : "?") + "type=html&p=" + ( ++curPage ),
                       success: function( html ){
                           html = jQuery.trim( html );

                           if ( html ) {
                               jQuery("#content-inner").append( html );
                              
//                             }
                           } else
                               curPage = 0;
                       },
                       complete: function(){
                           loading = false;
//                         alert(window.location.pathname + (window.location.search != '' ? ""+ window.location.search +"&" : "?") + "p=" + ( curPage ))
                           pageTracker._trackPageview(window.location.pathname + (window.location.search != '' ? ""+ window.location.search +"&" : "?") + "p=" + ( curPage ));
                           _qacct="p-ebK_XdQH1HeLo"; quantserve();
                           $("progressIndicator").style.display="none";
                       }
                   });
               }
           });
        });
    }
</script>
2011年3月27日 19:43
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics