Hi I found out that it is now working but only when I published it on to my iGoogle page and then ran the post request. It didn't work when I was previewing the gadget. So can the gadgets API library only be used when its published as a Gadget?
Thank you Jaz On Feb 24, 12:56 pm, jazKular <[email protected]> wrote: > http://hosting.gmodules.com/ig/gadgets/file/111110564125740895625/Aca... > > i have put alerts in the code that should show that the post has been > completed. > > The POSTRequest method does not get completed. It fails when it > attempts to use the gadgets.io library. > > The data that is to be posted is just some sample data, not the actual > data I am going to post to the server. Just want to check if posting > actually works. > > Could you tell me what I need to add or remove from the xml. > > Thank you > Jaz > > On Feb 24, 7:51 am, Vinod facebook <[email protected]> wrote: > > > Could you post the entire gadget xml ? > > > On Mon, Feb 22, 2010 at 11:57 PM, jazKular <[email protected]> wrote: > > > 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]<google-gadgets-api%2bunsubs[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/Google-Gadgets-API?hl=en.-Hide quoted text - > > > - Show quoted text - -- 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.
