- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Example of Event Handlers in HTML5 CORS
Cross-origin resource sharing (CORS) is a mechanism to allows the restricted resources from another domain in a web browser
For suppose, if you click on HTML5- video player in html5 demo sections. It will ask camera permission. If the user allows the permission then only it will open the camera or else it doesn't open the camera for web applications.
The following is an example of event handlers in CORS:
xhr.onload = function() { var responseText = xhr.responseText; // process the response. console.log(responseText); }; xhr.onerror = function() { console.log('There was an error!'); };
- Related Articles
- CORS in HTML5
- What are event handlers in JavaScript?
- How to remove event handlers in JavaScript?
- How to override jQuery event handlers?
- How to remove event handlers using jQuery?
- How to detect all active JavaScript event handlers?
- Example of MathML in HTML5
- Example of createSignalingChannel() in HTML5
- How to disable some jQuery global Ajax event handlers for a request?
- HTML5 IndexedDB Example
- HTML5 / JS storage event handler
- Difference between dragenter and dragover event in HTML5
- How to add many Event Handlers to the same element with JavaScript HTML DOM?
- How to use multiple click event on HTML5 canvas?
- EventSource vs. wrapped WebSocket with HTML5 Server-Side Event

Advertisements