Hello ,
I saw something in the help on this but no code what so ever. This is a feature of webdevelopment since 2006!!
Ok Has anyone ever used this with webdev?
I Need to add some servercode in phpo it would be like this
header('Content-Type: text/event-stream');
header('Cache-Control: no-cache');
$time = date('r');
echo "data: The server time is: {$time}\n\n";
flush();
The javascript to get the page changes would be like this
var source = new EventSource("PAGE_Onderhoiud.php");
source.onmessage = function(event) {
document.getElementById("result").innerHTML += event.data + "<br>";
There is no framework or anything used . This is it. SSE is great . A lot less overhead then witch websockets as that is a whole different protocol
Adding the phpo and the javascript does not work!! ( at least if I try it ) . The code runs without webdev like a charm
Regards