Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. Cross-Origin
Resource Sharing (CORS) is a browser technology specification, which
defines ways for a web service to provide interfaces for sand boxed
scripts coming from a different domain under same origin policy. CORS is
a modern alternative to the JSONP pattern. While JSONP supports only the
GET request method, CORS also supports other types of http requests.
Using CORS enables a web programmer to use regular XMLHttpRequest which
supports better error handling than JSONP. On the other hand, JSONP
works on legacy browsers that do not have CORS support built into them.
CORS is supported by most modern web browsers .