5 messages in com.googlegroups.google-gadgets-apiOnload handlers| From | Sent On | Attachments |
|---|---|---|
| Vision Jinx | 27 Oct 2006 07:04 | |
| Dann (Google Employee) | 27 Oct 2006 10:15 | |
| Justin McConnell | 27 Oct 2006 11:43 | |
| Vision Jinx | 28 Oct 2006 03:30 | |
| Justin McConnell | 07 Nov 2006 13:10 |
| Subject: | Onload handlers![]() |
|---|---|
| From: | Vision Jinx (vjn...@gmail.com) |
| Date: | 10/27/2006 07:04:12 AM |
| List: | com.googlegroups.google-gadgets-api |
Hi,
I am hoping someone can please help me out with this...
I am having a couple issues here. I am definitely not the strongest with javascripts especially when working with loops and arrays. I did some reading in a couple old books of mine looking for examples and was eventually able to hack out a working script, but one issue I keep hitting is, I sometimes use <body onload="onload1();onload2();"> when I need more then one body onload happening, but with Gadgets this seems to be quite the problem for me.
According to the online documentation it says I don't need to be using the _IG_RegisterOnloadHandler if I am not making an inline gadget. (which I am not)
"Note that this is only useful for inlined gadgets, since iframe gadgets can simply register onload by using the document.body.onload = ... function."
I keep trying that and I can sometimes seem to make it work in Firefox but it just wont work for me in IE. It generates a not very helpful error and points to this line.
document.body.onload = vj_setbg();vj_cycleBlogs();
I have Google this many times (document.body.onload) and have not found anything that seems helpful.
So, I have had luck using _IG_RegisterOnloadHandler instead and that seems to work, but when I try to load more then one function _IG_RegisterOnloadHandler(vj_setbg();vj_cycleBlogs()); it generates an error saying I am missing a )
I have also tried adding the entire script there too like in the online examples, but that totally didn't work.
So back to the documentation and it says...
"Event handler that gets called on load. Takes a single argument, which is a function that is called after the page loads. The passed function takes no arguments."
so it looks like I can only load one thing? I can not figure out how this is suppose to be done correctly. It's given me about 15 grey hairs so far. 8(
So another hack workaround... I added it into another function...
... vj_cycleBlogs(); }
_IG_RegisterOnloadHandler(vj_setbg());
This seems to work in both IE and FF but man there has to be a better way to do things here. 8(
Any guidance/suggestions would be most appreciated.
BTW - When I uploaded then new working version, Google seems to have cached the old one that doesn't work with IE. (with the document.body.onload)
I found if I deleted it from my Google homepage, and removed the link from the developer module and re-added it and it seems to load the correct one there, but this link still displays the non working version... >> http://gmodules.com/ig/creator?synd=open&url=http://www.visionjinx.net/gg/bhg_v1/bhg_v1.xml How do I totally clear this from Googles caches?
Very Sorry for the long post, but I have had quite the time trying to figure this out, and am trying to provide as much info that I think may help.
Again, any guidance and suggestions would be most appreciated. 8)
My current version is here >> http://www.visionjinx.net/gg/bhg_v1/bhg_v1.xml
Cheers! Vision Jinx




