Pages tagged xhr:

Ajaxian » Designing a JavaScript client for a REST API
http://ajaxian.com/archives/designing-a-javascript-client-for-a-rest-api

So you want to write a script that sites all over the web can use to access your REST API, eh? Well, that would be pretty straightforward if it weren’t for two things: 1. browser same-origin restrictions on XMLHttpRequests (XHRs) and inter-window/frame access 2. the lack of wide browser support for HTML 5-style message passing between windows. The Same-Origin Policy and its minor browser-specific variations are detailed elsewhere, so I’ll just summarize it with a few key points. I use the term window to mean window object, which can be a top-level page or reside inside a frame or iframe.
So you want to write a script that sites all over the web can use to access your REST API, eh? Well, that would be pretty straightforward...
A comprehensive article outlining an approach on how to create a RESTful JavaScript client. The article explains not only how to create a client for your own RESTful services, but also interacting with cross-domain ones. There is also code posted on Google Code which implements the concepts presented in the article.
Cross-domain Ajax with Cross-Origin Resource Sharing | NCZOnline
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
Avoiding proxy use for cross-domain ajax request, easier than you thought.
A couple of years ago, web developers were banging their head against the first wall in Ajax: the same-origin policy. While we marveled at the giant step