function sendRequest()
{
var params = {};
var url = "http://localhost/Search.php";;
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.POST_DATA] = "kwd=" + kwd + "&Type=" +
Type +  "&SearchBy=" + By + "&render=json";
gadgets.io.makeRequest(url, response, params);
}

function response(obj)
{
alert(obj.data); //alerts null
}
For normal ajax request, it is working fine (Getting response), But here, I
am getting a null response.

Is there any problem with this code?


On Mon, Jun 9, 2008 at 1:50 PM, Chris Chabot <[EMAIL PROTECTED]> wrote:

> Yes absolutely, thats what the gadgets.io.makeRequest(url, callback)
> function is for!
>
> It proxy's your request through shindig (which is on the same domain as the
> gadget), so no problems with domain origin policy's
>
> Ps, if your trying to run 'existing' code in a gadget you could consider
> making a wrapper script that pretends it's your toolkit's Ajax.Request
> function, but actually performs a makeRequest function,as an example, I
> created such a thing for prototype.js Ajax.Request back in the 0.5 days
> (when gadgets.io.makeRequest was still called _IG_FetchContent):
> http://www.chabotc.com/wp-content/uploads/2007/11/osajax.js
>
>        -- Chris
>
>
> On Jun 9, 2008, at 8:38 AM, Neo Anderson wrote:
>
>  I have my Container at port 80 and server at 8080. I am using ajax in my
>> gadget (Content type="HTML"). So, my Ajax requests are failed (Permission
>> denied because iFrame source is at 8080 and files to which I am sending
>> Ajax
>> requests are at port 80). Is there any alternative for sending Ajax
>> requests
>> to my Files at port 80?
>>
>
>

Reply via email to