Lernprogramm aus W3schools

HTML APIs

HTML SSE API

Server-Sent Events (SSE) allow a web page to get updates from a server.

Server-Sent Events - One Way Messaging

A server-sent event is when a web page automatically gets updates from a server. This was also possible before, but the web page would have to ask if any updates were available. With server-sent events, the updates come automatically.

Receive Server-Sent Event Notifications

The EventSource object is used to receive server-sent event notifications:

Getting server updates

Der Test endet mit einem Fehler in der Konsole:

        EventSource's response has a MIME type ("application/x-httpd-php") 
        that is not "text/event-stream". Aborting the connection.
    

Wenn keine Serverantworten kommen, dann hat der Webserver keinen PHP-Interpreter eingebunden ...