起初我想让tab中引入其余的html。但我发现html文本是引进来了,但中的<script>内容没法触发,如
javascript
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脚本触发html
loader:{ url:'home/index.htm', autoLoad:true, scripts:true, renderer : function(loader, response, active) { loader.getTarget().update(response.responseText, true); return true; } }