On 28 May, 00:31, Alexander <[email protected]> wrote:
> Please help out the n00b here.
What JavaScript error are you getting from the gadget? That would be a
good place to start.
Just reading the code by eye - always risky, it's much better if you
post a link to your gadget rather than pasting the source in here - it
looks like <img id="one" /> doesn't exist if the preference is TWO. In
this case, _gel("one").src will fail, because there is no element with
id="one", and the code will never reach _gel("two").src.
Overall, this looks like a lot of work to do what you want. Why the
DHTML? Why not a single img element, and just set its src in the
onload handler? Something like this (untested):
<script type="text/javascript">
IG_RegisterOnloadHandler(function() {
var prefs = new _IG_Prefs();
if (prefs.getString("c") == "ONE") {
_gel("image").src = _IG_GetImageUrl("http://
alexandr.isakov.googlepages.com/pic1.gif");
} else {
_gel("image").src = _IG_GetImageUrl("http://
alexandr.isakov.googlepages.com/pic2.gif")
}
};);
</script>
<img id="image" border="0" />
Also, your code that looks like src="_gel("one")" isn't going to do
anything useful, and probably produces invalid HTML to boot. Just
FYI.
String
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---