Pages

Wednesday, 3 July 2013

How To Check Internet Connection using jQuery Example in C# Asp.Net

How To Check Internet Connection using jQuery Example in C# Asp.Net


Program:

.Aspx File:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Check Internet Connection</title>
<script type="text/javascript">
    function checkconnection() {
        var status = navigator.onLine;
        if (status) {
            alert("online");
        } else {
            alert("offline");
        }
    }
</script>
</head>
<body>
<div>
<input type="button" value="Check Connection" onclick="checkconnection()" />
</div>
</body>
</html>

Live Demo:

Check Internet Connection

No comments:

Post a Comment