惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
V
Visual Studio Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MongoDB | Blog
MongoDB | Blog
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
L
LangChain Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
博客园 - 司徒正美

博客园 - 王大湿

2026年抖音、小红书、快手、微信小程序流量玩法差异拆解:适合中小商家的平台选择指南 2026年中小商家打通抖音小红书快手私域流程:微信小程序怎么实现多平台用户统一沉淀变现 改性/生物基尼龙新材料优质公司怎么选?2026年各细分领域头部企业盘点 源于现实的启发性算法:模拟退火与混合策略 AI时代的品牌监测技术发展趋势 ISO in CSS content 阿里云OSS多图上传 无法将 DROP TABLE 用于 ,因为 是 未知类型。 Entity Framework 多字段排序 阿里巴巴全部行业分类 ServerVariables Levenshtein Distance 字符串的距离 Response.Status Entity Framework linq 分割DataTable MSN OAuth 2.0 API HTTP 状态代码 正则表达式常用字符、代码 导出扣扣漫游聊天记录 Tencent://Message/协议的实现原理
append2 给append 添加回调方法
王大湿 · 2014-08-22 · via 博客园 - 王大湿
   $.fn.append2 = function(html, callback) {
        var originalHtmlLength = $("body").html().length;
        this.append(html);
        var nums = 1;
        var timer1 = setInterval(function() {
            nums++;
            var clearIntervalfun = function() {
                clearInterval(timer1)
                callback();
            } 
            var flag = originalHtmlLength != $("body").html().length || nums > 1000;
            // console.info("append html expend {0}ms".format(nums))
            flag && clearIntervalfun()

        }, 1)
    };

posted @ 2014-08-22 18:21  王大湿  阅读(847)  评论(0)    收藏  举报