a66555555555555

\n\n<h3>2.2 动态加载Dynamic Loading</h3>\n\n<p>Open the Chrome Developer Tools and click on the Console option.  Now refresh the Hello Ext application.  You should see a warning in the console that looks like this:</p><p>打开Chrome的开发工具,然后按一下控制台上的选项。现在刷新你好分机应用。你应该看到一个看起来像这样在控制台的警告:</p>\n\n<p><p><img src=\"guides/getting_started/loader-warning-viewport.png\" alt=\"testing\"></p></p>\n\n<p>Ext JS 4 comes with a system for dynamically loading only the JavaScript resources necessary to run your app.\nIn our example <code>Ext.create</code> creates an instance of <code>Ext.container.Viewport</code>.  When <code>Ext.create</code> is called the loader will first check to see if <code>Ext.container.Viewport</code> has been defined.\nIf it is undefined the loader will try to load the JavaScript file that contains the code for <code>Ext.container.Viewport</code> before instantiating the viewport object.  In our example the <code>Viewport.js</code> file gets loaded successfully, but the loader detects\nthat files are being loaded in a less-than optimal manner.  Since we are loading the <code>Viewport.js</code> file only when an instance of <code>Ext.container.Viewport</code> is requested, execution of the code is stopped until that file has been loaded successfully, causing a short delay.\nThis delay would be compounded if we had several calls to Ext.create,  because the application would wait for each file to load before requesting the next one.</p><p>动态加载的JavaScript必要的资源来运行您的应用程序与系统的Ext JS 4。在我们的例子Ext.create创建一个实例Ext.container.Viewport。被称为Ext.create时装载机将首先检查看到,如果Ext.container.Viewport已被定义。如果它是不确定的,loader会尝试加载的JavaScript文件包含代码Ext.container.Viewport的实例视口中的对象之前。在我们的例子Viewport.js文件被加载成功,但装载机检测该文件正在装载在低于最佳方式。由于我们正在装载的Viewport.js文件,只有当一个实例Ext.container.Viewport的要求,停止执行的代码,直到该文件已被成功加载,造成了短暂的延迟。这种延迟会加剧,如果我们有几个的呼吁Ext.create,因为应用程序会为每个文件等待下一个请求之前加载</p>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值