Load a script file in sencha, supports both asynchronous and synchronous approaches
//http://www.sencha.com/forum/showthread.php?188318-Ext.Loader.loadScriptFile-wrong-URL
Ext.Loader.loadScriptFile("/a.js", function() {
console.log('hello loadScriptFile callback'); }, undefined, true
);
//you can load script from local
//and also, you can load script from remote server
//for example,you can load a jquery lib from jquery CDN
Ext.Loader.loadScriptFile("http://code.jquery.com/jquery-2.0.3.js", function() {
console.log('hello loadScriptFile callback'); }, undefined, true
);
//you now can use jquery functions
console.log($('body')[0].innerHTML)
//above will error,you can't use $ at this place this moment, because the Loader loading files async,your code is not loaded just now
// you can try
//http://www.sencha.com/forum/showthread.php?188318-Ext.Loader.loadScriptFile-wrong-URL
Ext.Loader.loadScriptFile("http://code.jquery.com/jquery-2.0.3.js", function() {
console.log('hello loadScriptFile callback');
//once your script load successfully, you can use your functions from the new imported lib
console.log($('body')[0].innerHTML);
}, undefined, true
);
Load a script file in sencha, supports both asynchronous and synchronous approaches的更多相关文章
- 网页提示[Not allowed to load local resource: file://XXXX]错误
网页通过http 访问时, 点击打开文件的link.在Chrome 中会报 Not allowed to load local resource: file// XXXX 的错误 <!--Add ...
- Failed to issue method call: Unit httpd.service failed to load: No such file or directory.
centos7修改httpd.service后运行systemctl restart httpd.service提示 Failed to issue method call: Unit httpd.s ...
- 报错:Unable to load configuration. - action - file:/E:/apache-tomcat-8.0.37/webapps/20161102-struts2-3/WEB-INF/classes/struts.xml:11:73
第一种报错: 严重: Exception starting filter struts2Unable to load configuration. - action - file:/E:/apache ...
- 遇到一个奇葩的问题,could not load the assembly file XXX downloaded from the Web
在我这编译好好滴,发给客户那边居然不通过,报could not load the assembly file:///xxx.dll, 查阅了一些文档后,发现原来是文件的安全问题,是由于我把文件压缩打包 ...
- 出现错误:Unable to load configuration. - action - file:/E:/Java/Tomcat7.0/apache-tomcat-7.0.68-windows-x64/apache-tomcat-7.0.68/webapps/SSH2Integrate/WEB-INF/classes/struts.xml:8:43
严重: Exception starting filter struts2 Unable to load configuration. - action - file:/E:/Java/Tomcat7 ...
- Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式
Failed to issue method call: Unit mysql.service failed to load: No such file or directory解决的方式 作者:ch ...
- Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/classes/struts.xml:11:71
Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/ ...
- options.html:1 Refused to load the script 'xxxx' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".
/********************************************************************************* * options.html:1 ...
- Caused by: Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/classes/struts.xml:7:72 at com.opensymphony.xwork2.config.ConfigurationManager.getConfigurati
Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/class ...
随机推荐
- jemalloc源码结构分析(三):arena_malloc_small内存分布
在arena_s结构中,由NBINS数组将bin按照不同规模等级分别存储,每一个等级对应一颗run树,即一颗以chunk_map_t为节点的红黑树,而这些chunk_map_t节点实际分布于各个chu ...
- JS判断单选框是否选中
判断单选框是否选中$("#isallday").attr("checked")
- url解析
window.onload=function(){ var url="http://www.qq.com/index.html?key1=1&key2=2&key3=3&qu ...
- Matlab图像函数之pie
一.pie pie用于描绘平面饼图. (1)pie(X) 利用向量X中的数据描绘饼图. 例如: X = [1, 1, 2, 2, 3, 4, 5]; pie(X) 得到 注意,X中的数据被看做频数,饼 ...
- 虚反矩阵指令pinv之应用
pinv指令 在多数解的例子中,有时并不是仅要将其中一变数设定为零之解.为使整个系统得到最佳化,亦可利用pinv指令求得最小模组之合理解.pinv(A)又称为虚反矩阵(pseudoinvers ...
- selenium添加源码,解决打开源码不显示问题
问题1: 我已经导入了源码包,单在源码中点击get,想查看源码 WebDriver driver=new FirefoxDriver(); driver.get("http://www.ba ...
- [转]Markdown 11种基本语法
Markdown 11种基本语法 现在是我在学习Markdown时做的笔记.学完这些Markdown的基本使用已经不成问题. 1. 标题设置(让字体变大,和word的标题意思一样) 在Markdown ...
- Microsoft Visual Studio 2013 Update 1 离线安装程序
☆ 微软官网地址:☆http://www.microsoft.com/zh-cn/download/details.aspx?id=41650☆ 离线安装程序 直接下载链接:☆http://downl ...
- java 反射机制探究
一 反射机制操作类的成员变量 二 操作类的方法 三 利用反射实例化类 四 利用反射访问一个类的私有成员 五 利用反射覆盖数据对象的toString 方法
- java中的拷贝文件FileChannel
以前用Java拷贝文件,只知道写byte数组循环拷贝,今天知道了可以用FileChannel进行拷贝,上代码: 下边是传统的byte数组拷贝方法 </pre><pre name=&q ...