PDA

View Full Version : Auto-Refresh



tlili
1 Jul 2009, 2:20 AM
Hello !

I have used the following code in order to Auto-Refresh a 'Div' in my web page
The problem is that the following code works only with one version (till now) of firefox and doesn't work with google chrome


var mgr = new Ext.Updater("mydiv");
mgr.startAutoRefresh(1, "/cgi-bin/cgi-test.cgi",true);
mgr.on("update", myfcn);
function myfcn(){
Ext.Ajax.request({ //...});
}


I need a solution to make this code functional with the most of browser or
if there is an equivalent function, which is better, to make an Auto-Refresh

Please I need your help !

begineer2
1 Jul 2009, 3:13 AM
Dude, try to be more specific on what exactly is not working.

Is the updater returned ok?
If no, try


Ext.get('myDiv').getUpdater()
If the url is called ok by the updater but the update event is not fired, try to use the callback function of the startAutoRefresh method


updater.startAutoRefresh(10, "myUrl",
{param1: value1,
param2: value2,
},
function(el, success){
alert('reloaded after 10 seconds..');
}
);

Or is the updater fired and you have some problems with the Ajax request from the function called when the update event is fired?

I didn't tried this code.. but it should work.