首页 新闻 赞助 找找看

ExtJS动态加载 js脚本文件

0
悬赏园豆:50 [已关闭问题] 关闭于 2013-05-27 13:23
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="LoaderDemo/ext-bootstrap-debug.js"></script>
    <!--<script  type="text/javascript" src="js/ext-4.0.7-gpl/bootstrap.js"></script>-->
    <script>
        Ext.Loader.setConfig({
            enabled: true,
            basePath: 'js'
        });
        Ext.require("Product");
        function test() {
            var product = new Product();
            alert("name: " + product.name);
        }
        </script>
</head>
<body>
    <button onclick="test();">TEST</button>
</body>
</html>

如图,请问一下,我使用的是ext-4.0.7-gpl的开发包,引入的js脚本文件为

ext-4.0.7-gpl/bootstrap.js,此时,动态加载脚本,是不成功的,总是提示,Product未定义。而参考动态引入的Demo,将它引入的js加载到页面,代码不用做任何修改,功能正常,请问这是什么问题呢、

冲动的主页 冲动 | 菜鸟二级 | 园豆:394
提问于:2013-05-27 10:56
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册