I’ve got this:
try{var conn = new WebSocket('ws://' + sessionStorage.ip + ':5565');}
catch (Exception) {location = "error.html";}
I would expect this to redirect me as soon as it reaches location = "error.html"
Later on in the script I have:
conn.onopen = {blah blah
But it crashes with
0x800a138f - JavaScript runtime error: Unable to set property 'onopen' of undefined or null reference
So the websocket isn’t being created, and while the catch does get the exception, it doesn’t redirect immediately, instead continuing on for a bit until the actual redirection.
How do I fix this?
I previously had the redirect in the
<body>tag.I should have had it in the
<head>