var e = Ext.get('testRefresh'); //取得id属性值'testRefresh'的span元素引用
var mgr = e.getUpdater(); //创建该span元素的UpdateManager实例
mgr.disableCaching = true; //关闭内容cache,否则会取cache中的内容,而不会刷新
mgr.showLoadIndicator = false;
mgr.on('beforeupdate',function(el){
e.fadeOut(); //淡出
});
mgr.on('update',function(el, response ){
e.fadeIn(); //淡入
var doc = response.responseText; //得到action的返回内容
Ext.get( "testRefresh" ).dom.innerHTML = doc; //更新span元素的内容(加粗、斜体)
});
mgr.startAutoRefresh(
2, //每隔2秒刷新一次
"http://127.0.0.1:8088/presence/testRefresh.php", //一个struts action,从后台取出新的数值,并以xml格式返回
null,
true
);
var mgr = e.getUpdater(); //创建该span元素的UpdateManager实例
mgr.disableCaching = true; //关闭内容cache,否则会取cache中的内容,而不会刷新
mgr.showLoadIndicator = false;
mgr.on('beforeupdate',function(el){
e.fadeOut(); //淡出
});
mgr.on('update',function(el, response ){
e.fadeIn(); //淡入
var doc = response.responseText; //得到action的返回内容
Ext.get( "testRefresh" ).dom.innerHTML = doc; //更新span元素的内容(加粗、斜体)
});
mgr.startAutoRefresh(
2, //每隔2秒刷新一次
"http://127.0.0.1:8088/presence/testRefresh.php", //一个struts action,从后台取出新的数值,并以xml格式返回
null,
true
);