Try putting the gadgets.util.registerOnLoadHandler(init) after the
functions.

I think the OnLoad is firing before the init function is loaded.



On Jan 2, 8:10 am, Simon Rawet <[email protected]> wrote:
> Hi, I think you have to include the wave javascript api right after <!
> [CDATA[
>
> If that dosent work chek the error console (ff have a grate one)
>
> --
> Sent from my iPhone
>
> On Dec 31, 2009, at 1:50 PM, Polson136 <[email protected]> wrote:
>
>
>
> > I can't seem to get my gadget to use Javascript. (HTML works fine) I
> > am new to both wave and javascript, and it is probably something very
> > simple. Here is a copy of my code:
>
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <Module>
> >  <ModulePrefs title="Hello Wave">
> >    <Require feature="wave" />
> >    <Require feature="minimessage"/>
> >  </ModulePrefs>
> >  <UserPref name="display" required="true" datatype="string"/>
> >  <Content type="html">
> >    <![CDATA[
> >       <script type="text/Javascript">
> >       gadgets.util.registerOnLoadHandler(init);
> >           function onClick() = {new gadgets.MiniMessage
> > ().createDismissibleMessage("hi")}
> >           var prefs=new gadgets.prefs();
> >           function listener() = {
> >               document.getElementById("display").innerHTML =  
> > prefs.getString
> > ("display");
> >           }
> >           function init() {document.write("Hello World");
> >           setStateCallback(listener);
> >           }
> >       </script>
> >       <font color='blue' id='color'>Hello, Wave!</font><button
> > type='button' onClick="document.write('Hello, World'">Hello, Wave!</
> > button><div id='display'></div>
> >    ]]>
> >  </Content>
> > </Module>
>
> > --
>
> > You received this message because you are subscribed to the Google  
> > Groups "Google Wave API" 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 
> > athttp://groups.google.com/group/google-wave-api?hl=en
> > .

--

You received this message because you are subscribed to the Google Groups 
"Google Wave API" 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-wave-api?hl=en.


Reply via email to