atom feed7 messages in[iGoogle Developer Forum] Re: gadgets...
FromSent OnAttachments
KevinSep 22, 2010 1:58 pm 
KevinSep 23, 2010 5:14 am 
Rob RussellSep 28, 2010 1:37 pm 
KevinSep 29, 2010 1:08 pm 
KevinOct 1, 2010 5:00 am 
Rob RussellOct 1, 2010 3:07 pm 
KevinOct 6, 2010 12:24 pm 
Subject:[iGoogle Developer Forum] Re: is undefined
From:Kevin (
Date:Oct 6, 2010 12:24:26 pm

Well, this is starting to work now. Thanks for the tip. I would have never thought of doing that on my own. I created a hidden input element and set its innerHTML to, and then was able to use the getElementsByTagName() method to access various items. Perhaps someone there at Google could add a "Working with HTML" section to to provide explicit guidance on how to do this.


On Oct 1, 6:07 pm, Rob Russell <> wrote:

If what you're receiving from the server is valid html then setting the innerHTML of an element in the DOM is one way to get at the response data with DOM methods. This should be similar to other cases where you have text that you want to treat as markup in a web page.

On Fri, Oct 1, 2010 at 5:01 AM, Kevin <> wrote:

OK - slowly breaking the code here.

If I change params[] to (from .DOM) then I can receive the HTML from the website, but apparently I can't treat it as a DOM object and access various elements (e.g. can't call"table")).

If I have to use with HTML results from other webpages, how do I then call DOM methods to access various elements?  Thanks!

On Sep 29, 4:08 pm, Kevin <> wrote:

I've figured out how to get my gadget into an iGoogle page by adding it via the "My Gadgets" gadget and it gets past the methods (but not in the GGE Preview pane).  It now fails in the callback function when I try to access the makeRequest argument.  The error just says "undefined" when I try to do something with in the following code.  Any suggestions?

<?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs   title="Tester, the Gadget"   title_url=""   description="Simple gadget to look up mutual fund data on fundAlarm"   author="Kevin" /> <Content type="html"><![CDATA[ <script type="text/javascript">

function makeDOMRequest() {     var url = "";     var params = [];     var userdata = {"ticker1" : document.getElementsByName("ticker1") [0].value};     try {       var postdata =;       alert("Submitted: "+postdata);       params[]= postdata;       params[] =;       params[] =;, response, params);       }     catch(err) {       alert("makeDOMrequest(): "": "+err.message);       }


function response(obj) {     alert("In response()");     try {       alert("About to try");       var funddata =;       alert(funddata);       var tabledata ="table");       var fundname = tabledata[1].rows[0].cells[0].innerHTML;       alert("Fund: "+fundname);       document.write("<br/><b>Fund: </b>", fundname, "<br/>");       //add more code when this is working...       }     catch(err) {       alert("response(): "": "+err.message);       }     } </script>

<div>   <CENTER>Enter a mutual fund symbol:<br/>   <input type="text" maxlength=5 size=6 name="ticker1" />   <input type="button" value="Go" onclick="makeDOMRequest();" />   </CENTER> </div> <p>Testing xxx...</p> ]]></Content> </Module>


On Sep 28, 4:37 pm, Rob Russell <> wrote:

I've seen similar problems when the Javascript starts to run before all resources are finished loading. Try starting your Javascript from an onload handler.

Rob Russell Google Developer Relations

On Thu, Sep 23, 2010 at 5:14 AM, Kevin <>


More details:  The HTML renders OK in the GGE Preview pane.  The javascript error occurs when I click a button that calls a javascript function that uses several methods and fields.

One other question about GGE: the preview tab puts all the html in a small dashed-line box that significantly restricts the real estate. What is up with that?  I can't seem to adjust it by setting the modulePrefs height and width.

On Sep 22, 4:58 pm, Kevin <> wrote:

Trying to create my first gadget using Google Gadget Editor in FF 3.6.8.  Tried to use the method per the Gadgets API Reference ( reference/) and the error console only says " is undefined".  No other errors.  What am I doing wrong?

-- You received this message because you are subscribed to the Google Groups "iGoogle Developer Forum" group. To post to this group, send email to To unsubscribe from this group, send email to<>


. For more options, visit this group at