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

推荐订阅源

量子位
Vercel News
Vercel News
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
H
Help Net Security
罗磊的独立博客
The Cloudflare Blog
J
Java Code Geeks
博客园 - 叶小钗
I
InfoQ
B
Blog
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
月光博客
月光博客
博客园_首页
雷峰网
雷峰网
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
美团技术团队
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美

博客园 - Love Fendi

性能优化系列---查询高cup的sql State模式学习 8.17--8.24积累 sql server 2005 analysis service step by step(三):创建父子维度 sql server 2005 analysis service step by step(二):创建时间维度 sql serve 2005 analysis service step by step(一):创建标准维度 算法练习五:求数组中第k大的数 算法练习四:求N!不溢出 算法练习三:奇偶分割 算法练习二:二分查找 数据库锁 算法练习一:最大公约数与最小公倍数 索引优化 生成验证码,同时异步获取加密后的验证码 自定义控件中与脚本资源集成的若干处理方式 一条语句删除表中某字段重复的数据 在Nhibernate中使用Json.net中出现Self referencing loop的错误的处理 JQuery学习笔记 c#委托事件 入门
动态按需异步加载js文件
Love Fendi · 2009-01-15 · via 博客园 - Love Fendi

 <script type="text/javascript">
       function YY(data) {
                execScript(data);
                    alert(data);
                }
                function CompleteDo() {
                    alert("complete!");
                    message();
                }
        function testeval() {
            //eval("id=1");
            $.ajax({
                url: "test.js",
                success: function(data) { YY(data); },
                error: function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest + textStatus + errorThrown); },
                complete: function() { CompleteDo(); }
            });
            //execScript("alert('aaa')");
            //alert(id);
        }
        if (typeof (message) == 'undefined') {
            alert("未定义");
            testeval();
        }
        else {
            message();
        }
       
      
        //execScript("message()");
        //alert(id);
    </script>

test.js的文件

var TestClass=function message() {
alert('aaa');

}