如下代码:
[code="java"]
function addTab(node){
defaultPanel.add({
title: node.text,
iconCls: 'tabs',
method:'post',
autoLoad:'hostinfo.action?hid='+node.id, //用这种请求不能返回数据,我打印node.id是有正常值的
autoLoad:'ajax1.html',//我用这个静态页面可以请求返回信息
width:700,
height:800,
closable:true
}).show();
}
[/code]
[b]问题补充:[/b]
autoLoad:'ajax1.html',//我用这个静态页面可以请求返回信息 现在的问题是虽然可以进入到这个页面但是我在这个页面写了个js。这是个静态页面,我直接双击打开该页面,里面的js正常运行,但是通过上面的方式过去,竟然说“函数不存在”,而且有报乱码,朋友说是autoLoad的提交方式需要怎么处理下,应该怎么弄啊?[img]http://hi.baidu.com/enilu/album/item/4680cd2383fd2d65935807cd.html[/img] ajax.html页面内容是:
改为试下:
[code="java"]autoLoad:{
url:'hostinfo.action',
params:{hid:node.id}
}[/code]
看api即知:
[quote]autoLoad : [b]Object/String/Function[/b]
[b]A valid url spec according to the Updater Ext.Updater.update method[/b]. If autoLoad is not null, the panel will attempt to load its contents immediately upon render.
The URL will become the default URL for this panel's body element, so it may be refreshed at any time.[/quote]
然后再去看看Ext.Updater.update的api就清楚了.
在tab添加如下属性
items: [ new Ext.ux.IFrameComponent({ id: id, url: uri }) ]
试试。
http://www.iteye.com/topic/143818
唉...常见问题之一...
不要autoload了,换iframe吧