I want to add a feature in my website. With this feature, when a user tries to open a page of my site, if the user is offline, my website will show a custom message that says you are offline, please reload. I saw this feature in XDA forum website and really impressed me.
I searched for it online but couldn't find a tutorial to make such feature. But one thing I understood that this can be achieved using something called service worker of js. But unfortunately I can write JavaScript and also don't understand the code.
So it will be great if someone help me add this feature in my website. Also I recommend you to visit the XDA forum to better understand what it looks like. Go to their website the. turn off the internet connection and refresh the page. You will see what I'm talking about.
thanks in advanced
As I don't know to write JavaScript, I haven't tried it yet. So I want your help to actually learn how to create this and implement into the website.