HTML5 Cross-Origin Resource Sharing (CORS)
What is CORS?
- It is abbreviated as Cross-origin resource sharing (CORS).
- It is a mechanism which allows the restricted resources from another domain in the web browser.
CORS request
The Httprequest2 object is used by the browsers like Chrome, Safari, Firefox. Internet Explorer uses the XdomainRequest object.
Event Handlers in CORS
Event Handlers | Description |
---|
onloadstart | It will start the request. |
onprogress | It will load and send the data. |
onabort | It aborts the request. |
onerror | It shows that the request is failed. |
onload | It requests the load successfully. |
ontimeout | It shows that there occurred a timeout before the request could be completed. |
onloadend | When the request is completed it can either be successful or a failure. |