• I came across a simple feature in Google/Facebook where if a user clicks a link(internal link, such as home –> profile) it doesn’t open up the next page but stays in the current page if there is the internet connection has been lost.

Viewing 2 replies - 1 through 2 (of 2 total)
  • This stackoverflow post
    https://stackoverflow.com/questions/2384167/check-if-internet-connection-exists-with-javascript
    describes various methods to check if you’re online.

    For your purposes, you’d likely want to use JS to intercept every click on a link. Within your function that intercepts clicks, you’d use one of the above methods to check if the user is online; if they are navigate to the URL and if they aren’t do some other action.

    If you implement this you’ll need to make a decision on checking online status every time a link is clicked (and significantly slowing down the performance of your site) or checking at some random interval and simply setting some variable.

    Thread Starter Sandeep Tripathy

    (@sandeeptripathy)

    Thanks for the help ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Check Internet Connection Before Proceed to Link’ is closed to new replies.