Hi, I emailed this from the wrong account so I don't think it will post so here was my comments on your question...
There are a couple techniques used to do this. One is what is referred to as JSONP (JSON with Padding) where the request to the server is done by dynamically writing a script tag (with the url including the query params) then the results are returned wrapped with a function call (eg. myCallback(jsonResults)) which would be your callback function. When the script loads it calls that function and you can parse the JSON data. This is not affected by the same domain policy. Another technique used is when making an AJAX http request where the same domain restriction applies you call a server side script (like PHP) and it will fetch the content (like a feed) then cache it on your server where it will then be "same domain" and can be fetched that way. Hope that makes sense Cheers! Vision Jinx On Feb 26, 6:18 am, Amirh <[email protected]> wrote: > there is something that i don't understand. From what i know, you > can't use AJAX from different domains. So when i use the google ajax > api from a non-google domain, how the browser allows it to make the > query? > Isn't it a violation of the security policy for ajax? > > Amir --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" 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-AJAX-Search-API?hl=en -~----------~----~----~----~------~----~------~--~---
