Reputation: 1
I have a web application that uses SSE to update available tables. It reads off a DB on its status whether its 1 or 2 and updates the seating arrangement accordingly.
However, i've been experiencing my browser crashing (while running the app) and its difficult to re-enact that error. I strongly suspect its the SSE that's causing the error.
below is the sample of the SSE codes I'm using, am i using it wrongly or is SSE currently unstable. I've done alot of googling on this, however no solution has been found yet.
var source = new EventSource('../_php/busy_tables.php');
source.onmessage = function (event) {
var data = JSON.parse(event.data);
for(var i=0; i<12; i++){
//create li list
}
};
I really appreciate any advise or help that is contributed.
Upvotes: 0
Views: 520
Reputation:
Report the bug to your browser vendor. They'll probably want a "minimized" test case, so it may help to find some way to trigger the bug outside your application and send them the scripts involved.
The only thing that really jumps out at me is the fact that you're using a variable named event
, as that has some (limited) special significance. Try changing the variable name (to, say, ev
) and see if the crash still occurs?
Upvotes: 1