You can do it all with Wappler rather than using Javascript. Add a Browser and a notify component to the page. Add a dynamic action in the Browser -> Offline dynamic event
Add some text. Done.