Hello;

I am a newbie gadget developer. I am currently trying to write my
first gadget. I want to get data from an asp page for test purposes. I
write the gadget using gge. And here is the code.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Post Test" >
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/javascript">
function makePOSTRequest(url, postdata)
{
  var params = {};
  postdata = gadgets.io.encodeValues(postdata);
  params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.POST;
  params[gadgets.io.RequestParameters.POST_DATA]= postdata;
  gadgets.io.makeRequest(url, response, params);
};

function response(obj)
{
  output(obj.text);
  document.getElementById( 'content_div' ).innerHTML = obj.text;
};

var data = {   data1 : "test",   data2 : 123456 };

makePOSTRequest("http://xxx.xxx.xxx.xxx/gadget/test";, data);
</script>
<div id="content_div"></div>  ]]>
</Content>
</Module>

It's a really simple gadget that would print out the contents of the
page. I got the function that makes the request from official google
page. ( 
http://code.google.com/apis/gadgets/docs/remote-content.html#methods-post
)

But when i add this gadget to my igoogle page and refresh the page i
get the error


Message: 'gadgets.io' is null or not an object
Line: 9
Char: 1
Code: 0
URI:
http://12.gmodules.com/ig/ifr?url=http://hosting.gmodules.com/ig/gadgets/file/107461615644691755266/PostTest4.xml&nocache=0&lang=tr&country=us&.lang=tr&.country=us&synd=ig&mid=12&ifpctok=2443643400389931915&parent=http://www.google.com&extern_js=/extern_js/f/CgJlbhICdXMrMBI4ACwrMBM4ACw/YFo2hOObZ2I.js

I think i am making a really simple mistake but cannot figure it out.
Can somebody please point me out my mistake.

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to