gadget trouble using javascript

0 views
Skip to first unread message

Polson136

unread,
Dec 31, 2009, 2:50:02 PM12/31/09
to Google Wave API
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>

Simon Rawet

unread,
Jan 2, 2010, 9:10:52 AM1/2/10
to google-...@googlegroups.com
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

> --
>
> You received this message because you are subscribed to the Google
> Groups "Google Wave API" group.
> To post to this group, send email to google-...@googlegroups.com.
> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en
> .
>
>

John Dungan

unread,
Jan 2, 2010, 9:20:32 PM1/2/10
to Google Wave API
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 <wzebera...@gmail.com> 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
>

Polson136

unread,
Jan 3, 2010, 8:00:56 PM1/3/10
to Google Wave API
You're both wrong. I told you it was probably something really simple
and that I was new. Javascript should not be capitalized. Sorry for
the waste of your time.
Reply all
Reply to author
Forward
0 new messages