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 ...
随机推荐
- 数据库通用Jdbc操作
public class JdbcUtil { /** * 关闭一个数据库链接 * @param conn */ public static void closeConnection(Connecti ...
- Maven学习小结(二 项目构建过程)
1.创建Maven项目 1.1 创建Maven项目的约定目录结构 1.2 编辑pom.xml <project xmlns="http://maven.apache.org/POM/4 ...
- C++ (P70—P96)
1 类的成员默认为私有模型 2 类的声明内不允许对数据成员进行初始化 3 类的成员函数,如果在类外定义,只需在函数类型之前加上inline就为内联函数了,如果在类内定义函数则该函数自动成为内联成员函数 ...
- 使用Vert.x构建Web服务器和消息系统
如果你对Node.js感兴趣,Vert.x可能是你的下一个大事件:一个建立在JVM上一个类似的架构企业制度. 这一部分介绍Vert.x是通过两个动手的例子(基于Vert.x 2.0). 当Node.j ...
- CSS——选择器
css选择器 css选择器可分为:标签(元素)选择器,ID选择器,类选择器,属性选择器,后代选择器,子代选择器,相邻兄弟选择器和兄弟选择器.... 标签选择器: //E{attr:value;attr ...
- 3D Touch的简单使用
6s发布以后新增了一个3D touch功能,我个人觉得这个功能点在某些时候还是挺方便的,比如说微信的扫码功能. 直接长按图标就可以进入这个功能里面,不用再打开app.一层层查找了,比较方便. 其实这个 ...
- SpringMVC Controller详解
SpringMVC Controller 介绍 一.简介 在SpringMVC 中,控制器Controller 负责处理由DispatcherServlet 分发的请求,它把用户请求的数据经过业务处理 ...
- 2.CentOS更换阿里源
第一步:备份本地yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 第二步:下载阿里y ...
- bvp4c--语法
bvp4c--语法 1. bvp4c: sol = bvp4c(odefun,bcfun,solinit) sol = bvp4c(odefun,bcfun,solinit,options) so ...
- xilinx 网站资源导读
[经验整理.01]Xilinx网站资源导读 ISE11版 标签: ISE Xilinx 入门 资源 2009-09-01 20:41 序 虽然自己也曾想过,但如果不是向农要求,把曾经写过的文 ...