Hi, everyone, I am a google gadget newbie.
I created a test gadget in iGoogle, and I defined a function named
"clear". When I add this function to <input> method onclick, it
doesn't work! When I changed function name from "clear" to "clean",
everything just works fine.
I don't know why, could someone explain this?
ps: I tested this in Firefox 3.0.5 using GGE
Here is my test gadget code:
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Dynamic Height" height="100">
<Require feature="dynamic-height"/>
</ModulePrefs>
<Content type="html"><![CDATA[
<script type="text/javascript">
function add(element){
var html = document.getElementById("container").innerHTML;
var msg = element.msg.value;
html += msg + "<br />";
setContent(html);
gadgets.window.adjustHeight();
}
function clear(){
setContent("");
}
function setContent(cont){
document.getElementById("container").innerHTML = cont;
}
</script>
<div>
<form>
Say:<input name="msg" type="text" /><input type="button" value="Add"
onclick="add(this.form)" /><br />
<input type="button" value="Clear" onclick="clear()" />
</form>
<div id="container"></div>
</div>
]]></Content>
</Module>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---