Thanks, Rohit :)

Here's an article explaining how to use makeRequest:
http://code.google.com/apis/opensocial/articles/makerequest-0.8.html

~Arne


On Nov 20, 9:29 am, Rohit Ghatol <[EMAIL PROTECTED]> wrote:
> Here is an explanation
>
> All your gadgets are typically hosted at Google in some kind of url
> like gmodules.com.  Now your ajax code is trying to accesshttp://example.com.
> Now this call is termed illegal and not allowed by browser, owing to
> Same Origin policy.
>
> The policy states the page has to be hosted from the same domain if
> ajax calls are made to a url in a domain. The same thing applies to
> iframe contents. If your page  (which is hosted at abc.com) contains a
> iframe which loads a page from another domain (xyz.com), the
> javascript in your page can not access the dom contents of this
> iframe.
>
> The reason why this is done - To stop malicious scripts cheat the
> users of web pages. See I may choose to embed a banking site as an
> iframe and then change some text boxes in that site to add a hook to
> provide me credit card number and cvv and post it to my site in ajax
> manner. Basically think of all the wicked things one can do.
>
> Now the main thing - Solution :
>
> There is one, use gadgets.io.makeRequest calls, these calls can access
> any resources hosted in any domains. No need to worry about cross site
> callback/same origin policy. I guess what all things you can do with
> ajax calls can be pretty much be done with gadgets.io.makeRequest
> call.
>
> Hope this helps,
> Rohit
>
> On Nov 19, 10:51 pm, Victor <[EMAIL PROTECTED]> wrote:
>
> > Can you please be more specific?  , the callback i am using to test
> > its just an alert and still doesnt work
>
> > code:
> >     $.ajax({
> >                         type: 'get',
> >                         cache: false,
> >                         url: 'http://example.com',
> >                         data: {},
> >                        dataType: 'json',
> >                        success: function(data) {
> >                       alert(data);
> >                      }
> >    });
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to