<html>
<body>
<p>The URL of the document that invoked the onmessage event:</p>
<div id="myDIV"></div>
<p><strong>Note:</strong> Server-Sent Events are not supported in Internet Explorer.</p>
<script>
if(typeof(EventSource) !== "undefined") {
var source = new EventSource("../html/demo_sse.php");
source.onmessage = function(event) {
document.getElementById("myDIV").innerHTML = event.origin;
};
} else {
document.getElementById("myDIV").innerHTML = "Sorry, your browser does not support server-sent events...";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onmessage_sse2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:57 GMT -->
</html>