Ruby's Louvre

每天学习一点点算法

导航

解读JSDeferred源码5

      window.onload = function(){
        var print = function(a){
          var d = document.createElement("div");
          d.innerHTML = a
          document.body.appendChild(d)
        }
        Deferred.loop(10,function(i){
          print(i)
        });
        Deferred.loop(10,function(i){
          print(String.fromCharCode(i+97));
        });
      }

posted on 2010-04-20 15:18  司徒正美  阅读(146)  评论(0编辑  收藏  举报