I can't seem to get the makeRequest method read new data. I've set up
this simple gadget app to illustrate my problem. Clicking "Get Data"
returns the JSON string [28063]. Adding the url parameter ?
condition=cancer will return the JSON string [0] in a browser.
However, in this application, that query with the added url parameter
also returns [28063].
I have been testing the app on my igoogle dev sandbox with caching
turned off for the gadget.
Is there something I'm missing here? I also attempted using a static
txt file as a JSON source, then updating the txt file on my server and
refreshing my igoogle dev sandbox to view the updated data, but only
got the old data.
The only way I can get the data to update is to either a) delete the
gadget from my igoogle dev sandbox page and reinstall it, or b) update
the gadget's xml file and refresh my igooge dev sandbox page.
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Fetch JSON Example"/>
<Content type="html">
<![CDATA[
<div id="content_div">
<a onclick="getdata('')" href="#">Get Data</a><br />
<a onclick="getdata('cancer')" href="#">Get Cancer Data</a><br />
<span id="count">count</span>
</div>
<script type="text/javascript">
function getdata(string) {
alert(string);
if (string != '') {
var url = "http://76.74.252.152/cgi-bin/count.cgi";
} else {
var url = "http://76.74.252.152/cgi-bin/count.cgi?" + "condition=" +
string;
}
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
gadgets.io.makeRequest(url, response, params);
};
function response(obj) {
alert(obj.text);
document.getElementById('count').innerHTML = obj.text;
};
</script>
]]>
</Content>
PS. I tried to submit this issue at
http://code.google.com/p/opensocial-resources/issues/entry?template=iGoogle%20Issue,
but the submit button was disabled and in trying to figure out how to
fix it, i lost the bug report that i'd written out.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---