Articles → JavaScript → Check if user is connected to internet or not in JavaScript

Check if user is connected to internet or not in JavaScript






Navigator.onLine





Example


<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta charset="utf-8" />
	<title></title>
	<script>
	alert(navigator.onLine);
	</script>
</head>

<body> </body>

</html>





Posted By  -  Karan Gupta
 
Posted On  -  Saturday, January 28, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250