I want a simply code, that checks the internet connection inside the browser and a handling that handles the various codes, that will come back.
I already tried a http-get-request to handle the returning status code, but at the end, I had some issues with the same-origin-policy.
I also tried the ononline- and onoffline-event, but these are depricated and do not work in my target-browser.
My 3rd option was with navigator.onLine. When the Browser got Internet Connection, the output is true. But, when my browser got not connection, the answer of navigator.onLine is not false...
My main use case is to check, if the browser got internet connection or not. If he got Internet Connection, then he should open www.abc.de But if there is no Internet Connection, he should open a local application with localhost:8080/abc.