I have been beating my head against a wall for too long with this
problem, probably because I don't know what I am doing. Basically, I
want to use a value from an external XML in a form input in my igoogle
gadget. Here is what I have so far, and I apologize for how bad it is,
but I pretty much don't know what I am doing.
(in this example, imagine only one instance of this element in the xml
<input type="hidden" name="test" value="213/51=+SG"> and I would like
to save 213/51=+SG as a var, in this case 'test' .)
Here is the script for the DOM request:
<![CDATA[
<div id="test"></div>
<script type="text/javascript">
function makeDOMRequest() {
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.DOM;
var url = "https://www.somewebsite.com/text.xml";
gadgets.io.makeRequest(url, response, params);
};
function response(obj) {
var html = "<div>";
var domdata = obj.data;
var test= domdata.getElementsByTagName("test").item
(0).getAttribute("value");
html +="</div>";
document.getElementById('content_div').innerHTML = html;
};
gadgets.util.registerOnLoadHandler(makeDOMRequest);
</script>
]]>
Then, I have an XML section which has a form which has the same string
as the external XML
<input type="hidden" name="test" value="test">
except I have used the var 'test' instead in hopes that would use the
var test as saved in the script above.
This is a total noob question, but I think there is a pretty easy
answer here, and I would appreciate any help I could get. Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---