Hi

I am having a very annoying problem with gadgets.io.makeRequest(). I
cannot for an unknown reason, post data to a remote server. I have
worked out using alerts that the makePOSTRequest() is not being run.

The following snippet is a portion of my code:

<Module>
  <ModulePrefs
    title="Academic Calendar Gadget 1"
    height="280"
    width="300"
    description="Academic Calendar Gadget"
    scaling="false"
    author="Jaz Kular"
    category="tools">
  </ModulePrefs>
    <Content type="html">
     <![CDATA[

<script src="http://www.google.com/jsapi";></script>
<script>

    google.load("gdata", "1.x");

    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);
    };

   function uploadFields() {

      var data = {   data1 : "test",   data2 : 123456 };
      makePOSTRequest("http://jazgadget.appspot.com/gadget";,
data);

      alert("COMPLETED");
    }

</script>
 <body onload = "uploadFields();" />

At the moment all I am doing is try to get the makePOSTRequest() run
correctly. Once this is achieved, I can then work with the real
content.

It's a form based gadget and all that is required is for the inputted
data to be posted to my server. A very simple thing which is not
working for me at all. I have searched through many tutorials and I am
not sure what is missing. I grabbed the code for posting data from
http://code.google.com/apis/gadgets/docs/remote-content.html.

Is there any code that is missing? Do I need to import libraries?

Please could you shed light on this matter.

I am so grateful for any assistance you can offer me.

Thank you
Jaz Kular

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