5 messages in com.googlegroups.google-gadgets-apiFunction call| From | Sent On | Attachments |
|---|---|---|
| Rob | 19 Nov 2007 11:15 | |
| Matt (Guru) | 19 Nov 2007 11:54 | |
| Rob | 19 Nov 2007 13:34 | |
| Matt (Guru) | 19 Nov 2007 14:15 | |
| Rob | 19 Nov 2007 17:00 |
| Subject: | Function call![]() |
|---|---|
| From: | Rob (r....@robashburn.com) |
| Date: | 11/19/2007 11:15:07 AM |
| List: | com.googlegroups.google-gadgets-api |
Hi all,
Is there any known issue with calling a function from within the callback function specified by _IG_Callback?
I'm using _IG_Callback with _IG_FetchContent to fetch content from a sequence of URLs held in an array:
_IG_FetchContent(sites[0],_IG_Callback(siteCheckCallback,0));
where the second parameter of _IG_Callback is the index into the array of the current URL. In the checkSiteCallback function, I do some processing then increment that value and make a new call until I've got to the end of the array.
That's been working fine, until I separated out some of that processing into another function. Now, in the callback function, I do something like:
function siteCheckCallback(responseText,index){ // do some processing document.write("calling updateCounter"); updateCounter(index,True); document.write("returned from updateCounter"); // do some more processing and call _IG_FetchContent again }
function updateCounter(idx,up){ document.write("in updateCounter"); // do some processing document.write("ending updateCounter"); }
Everything goes as I expected up to the call to updateCounter in the siteCheckCallback function. At that point, nothing else seems to happen - none of the code in the updateCounter function is ever executed, and the code in the callback following the call to updateCounter doesn't happen either.
I'm new to Gadgets, and I'm no Javascript expert either, so it may well be that I'm missing something really obvious here. Any suggestions would be much appreciated!




