下面的tab中把testX.htm加载过来
那么在各个testX.htm中的[color=blue]是否可以定义重名的全局变量,或者声明一样的函数[/color]呢?
我试了一下,如果这样的话,后打开的页面的全局变量会覆盖先打开的页面的变量
而后打开的页面的函数会覆盖先打开的页面的函数
那么[color=blue]我怎么阻止这种覆盖[/color]呢?
Ext.onReady(function(){
Ext.QuickTips.init();
var tabsDemo=new Ext.TabPanel({
renderTo:'hello',
activeTab:0,
width:500,
height:500,
enableTabScroll:true,
items:[]
});
var index=0;
Ext.get("AddNewTab").on("click",function(){
tabsDemo.add({
title:"newtab"+index,
id:"newtab"+index,
//html:"new tab"+index,
[color=darkred][b]autoLoad:{url:"test"+index+".htm",scripts:true},[/b][/color]
closable:true
});
tabsDemo.setActiveTab("newtab"+index);
index++;
})
});