Hi everyone!
I have one ease questions for all you pros up there.
I am trying to create a simple gadget that will be displaying a pre-
defined default picture/pictures. User will be able to change that
picture in the UserPrefs with another pre-defined picture. Pictures
has to be optimized.
Heres a simplified version of gadget with only 2 pictures to choose
from:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Test" height="100"/>
<UserPref name="c" display_name="Picture" default_value="ONE"
datatype="enum" >
<EnumValue value="ONE" />
<EnumValue value="TWO" />
</UserPref>
<Content type="html"><![CDATA[
<script type="text/javascript">_IG_RegisterOnloadHandler(function() {
_gel("one").src = _IG_GetImageUrl("http://
alexandr.isakov.googlepages.com/pic1.gif");
_gel("two").src = _IG_GetImageUrl("http://
alexandr.isakov.googlepages.com/pic2.gif")
})</script>
<script type="text/javascript">
var prefs = new _IG_Prefs();
var a = null;
var b = prefs.getString("c");
if (b == "ONE") {a ='<img id="one" border="0" alt="ONE" src="_gel
("one")"/>'}
else if (b == "TWO") {a ='<img id="two" border="0" alt="TWO" src="_gel
("two")"/>'};
document.write(a);
</script>
]]>
</Content>
</Module>
After installed to iGoogle, it shows the default picture ONE ok.
However, when user changes the picture through User Preferences to
picture TWO, picture two appears broken...
I know I messed something up in the code and would appretiate any help
and advices :)
Please help out the n00b here.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---