Hi there,
I’m using the ‘heyoffline’ script (https://github.com/oskarkrawczyk/heyoffline.js) to determine whether users have an active internet connection, and if not, show a notification.
What I want to do is onload, check if they are online, and if so, redirect to another page, but if offline, load as normal. I’m not sure how to code this.
Basically, there are 2 events: onOnline and onOffline - but my javascript skills are so minimal, I cant work out how to check if one event is fired when the page is loaded.
I want to accomplish this:
If onOnline = true, then redirect, otherwise just load page as normal.
Any help would be great.
Thanks