Assuming we allowed cross-domain Ajax requests.
The code would look something like this:
$.post('http://google.com/get/emails/all', function(emails){
// I can see your emails
readAllEmails(emails);
});
What are the security risks with this call, won't mail.google.com just deny the request and that would be the end of it?
Edit To clarify the question above.
In the scenario above which cookies get sent to mail.google.com. is it all the cookies that your browser is currently storing or is just the domain cookies? If its all the cookies then I understand why cross domain ajax calls are an issue. However if that was the case I don't understand why the browser would send all the cookies, what is the advantage?