Horje

Example of Browsing Support check HTML SSE API

First we need to check the browser support for server-sent event. So to check the browser support for Server-sent event we will check the EventSource object is true or not. If it is true then it will give alert for supporting else it will give alert for not supporting.

index.html
Example: HTML
<script>
if(typeof(EventSource) !== "undefined") {
  // Yes! Server-sent events support!
  // Some code.....
} else {
  // Sorry! No server-sent events support..
} 
</script>

Output should be:

Example of Browsing Support check HTML SSE API




Type:
html
Category:
Web Tutorial
Sub Category:
HTML SSE API
Uploaded by:
Admin