Javascript 在ExtJS4中加载外部脚本
在ExtJS4中,我需要加载D3API。我正在使用下面的代码Javascript 在ExtJS4中加载外部脚本,javascript,extjs,Javascript,Extjs,在ExtJS4中,我需要加载D3API。我正在使用下面的代码 loadScript:function(callback,scope){console.log('5)loadScript called'); Ext.Loader.injectScriptElement('http://d3js.org/d3.v3.js'、空载、空载); log('D3脚本加载'); }, onError:function(){ log('On Error'); }, onLoad:function(){ con
loadScript:function(callback,scope){console.log('5)loadScript called');
Ext.Loader.injectScriptElement('http://d3js.org/d3.v3.js'、空载、空载);
log('D3脚本加载');
},
onError:function(){
log('On Error');
},
onLoad:function(){
console.log(“加载”);
d3.选择('body')。追加('div')。样式('position','absolute')。样式('padding','0 10px')。样式('background','red')。样式('opacity',0);
},
使用this.onLoad
和this.onError
,如下所示:
Ext.Loader.injectScriptElement('http://d3js.org/d3.v3.js', this.onLoad, this.onError, this);
(您也可以通过范围)