Hello Ty, In your simplified, I don't think it would be possible to get the error you describe. The drawImage function is declared after the url variable, so I don't think the former could exist without the latter.
Do you have an actual gadget URL you can point us to? It'd be helpful to see this problem in context. String On Nov 16, 5:20 pm, ty <[EMAIL PROTECTED]> wrote: > Hello, > > I have constants I'm loading globally. They are image URLs I use > frequently. > I am then using these constants in a function called by > _IG_RegisterOnloadHandler. > I notice that Firebug sometimes reports that my constants are not > defined. > > Is _IG_RegisterOnloadHandler getting called before the constants are > instantiated. Is this possible? If so, how can I prevent this? Here is > a simplified example: > > var url = "http://blah.com/"; > > function drawImage(ele, pic) { > _gel(ele).innerHTML = '<img src="' + url + pic + '"/>'; > // reports "url is undefined" > > } > > _IG_RegisterOnloadHandler(function() { > drawImage("pic1.gif"); > > }); > > Thanks, > Ty --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iGoogle Developer Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Gadgets-API?hl=en -~----------~----~----~----~------~----~------~--~---
