Check for working internet connection using JavaScript

function checkInternet() { var status = navigator.onLine; if (status) { alert("Working"); } else { alert("Not Working "); } }
Simple script that verifies if the client's browser is connected to the Internet.

#javascript #internet #connection #navigator #online


Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.