
Firefox can’t establish a connection to the server at https://example.com
I have a webserver and I want to implement server-event Source via: EventSource("API.php") but I ran into error on random requests! For example After 120 Requests I get the error or the other time after 31 requests! what is the problem and how to solve that?
Site CODE:
<!DocType 'html'> <html> <head></head> <body> <div id="result"></div> <script> if(typeof(EventSource) !== "undefined") { // Yes! Server-sent events support! // Some code..... var source = new EventSource("Example.php"); source.onmessage = function(event) { document.getElementById("result").innerHTML += event.data + "<br>"; }; } else { alert("Use FireFox to Load This Page! Your Browser is not supported...") } </script> </body> <footer></footer> </html>
Modified
All Replies (2)
See also:
Try to ask advice at a web development oriented forum.
This question has been locked because the original author has deleted their account. While you can no longer post new replies, the existing content remains available for reference.