I have a service variable that is initialized :
service = new google.gdata.calendar.CalendarService('timeless');
This happens in a callback function. My problem is that I have other functions that rely on the service variable. If I call them too soon the variable is undefined and the script does nothing.
The main problem would be if the user would try to click on a button that calls one of these functions. How can I make the function wait? If I use a cutsom spinlock it would kill the browser.
I need some kind of pseudo-mutex or wait/sleep function. I don't think that setTimeout would help.
Thanks.