Click to See Complete Forum and Search --> : internet connection
vinsa
08-27-2003, 04:26 AM
Hello,
I need for javascript for my webpage.
I use my page on my local computer
and want when onload the page, the
script to give me massage whether I have
internet connection or I havn't. Is this possible with
javascript?
Khalid Ali
08-27-2003, 08:20 AM
To find out if you have internet connection or not,you may be able to use a work around at this location (http://www.webapplikations.com/pages/html_js/document/FindOutAServerIsUp.html).
Its not the most reliable procedure(since the whole question is beyond the JavaScripts scope),it will work in most of the cases.
vinsa
08-27-2003, 01:43 PM
I try with navigator.onLine(boolean). But it not work. Can you help me?
<html>
<head>
<title>check</title>
<meta content="text/html; charset=windows-1251" http-equiv=Content-Type>
<script type="text/javascript">
<!--
function check() {
if (navigator.onLine(boolean)) {
alert("you are online")
}
else {
alert("you are not online")
}
}
//-->
</script>
</head>
<body onload="check()" >
</body>
</html>
Nevermore
08-27-2003, 02:04 PM
I've been trying for ages, but my computer won't massage me either!
:D