setInterval的使用和停用

            var res = self.setInterval(function(){
                         if(typeof(UE.getEditor('editor').body.innerHTML) != "undefined"){
                            UE.getEditor('editor').setContent(data.body);
                            clearInterval(res);
                            console.log("填充完毕,停止setInterval循环");
                        }
                        console.log("500ms执行一次,本次已结束了");
                    },500);

 

var res = self.setInterval(function(){       //console.log("开始填充body到UE.getEditor('editor').body.innerHTML");       //console.log("typeof(UE.getEditor('editor').body.innerHTML)是否已存在:"+typeof(UE.getEditor('editor').body.innerHTML));console.log(new Date().getTime());if(typeof(UE.getEditor('editor').body.innerHTML) != "undefined"){UE.getEditor('editor').setContent(data.body);clearInterval(res);console.log("填充完毕,停止setInterval循环");}console.log("500ms执行一次,本次已结束了");},500);

posted on 2016-01-26 14:32  潸何  阅读(709)  评论(0编辑  收藏  举报