起初我想让tab中引入其他的html。但我发现html文本是引进来了,但中的<script>内容无法触发,如
region : 'center',
xtype : 'reorderable-tabs',
items: [{
id:'tab-index',
title: '首页',
closable:false,
glyph: 62105
loader:{
url:'home/index.htm',
autoLoad:true,
scripts:true
}
}]
加载后,index.htm中的<script>文件无法引用,或其中的代码无法执行。于是就使用如下方法,让script脚本触发
loader:{
url:'home/index.htm',
autoLoad:true,
scripts:true,
renderer : function(loader, response, active) {
loader.getTarget().update(response.responseText, true);
return true;
}
}