- Code: Select all
<!doctype html>
<html>
<head>
<script>
function updateOnlineStatus(msg) {
var status = document.getElementById("status");
var condition = navigator.onLine ? "ONLINE" : "OFFLINE";
status.setAttribute("class", condition);
var state = document.getElementById("state");
state.innerHTML = condition;
var log = document.getElementById("log");
log.appendChild(document.createTextNode("Event: " + msg + "; status=" + condition + "\n"));
}
function loaded() {
updateOnlineStatus("load");
document.body.addEventListener("offline", function () {
updateOnlineStatus("offline")
}, false);
document.body.addEventListener("online", function () {
updateOnlineStatus("online")
}, false);
}
</script>
<style>...</style>
</head>
<body onload="loaded()">
<div id="myid">
table width="185" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="185" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left" valign="top"><p class="style1">Today's FAQ:
</p></td>
</tr>
<tr>
<td height="25" colspan="2" align="left" valign="top"><span class="style2">Q: What does the $19.95 monthly service fee cover? </span><a href="#" target="_self"><br />
</a></td>
</tr>
<tr>
<td height="40" align="right" valign="middle" class="table-border-bottom">Click for the answer!</td>
<td height="40" align="right" valign="top" class="table-border-bottom"><a href="faq.html" target="_self"><img src="images/go2-button.png" alt="GO!" name="Go" width="38" height="33" border="0" id="Go" /></a></td>
</tr>
<tr>
<td colspan="2" align="left" valign="top"><p class="style1">News:</style1>
Coming Soon!
</td>
</tr>
<tr>
<td width="156" height="40" align="right" valign="middle" class="table-border-bottom"><style2></style2></td>
<td width="44" height="40" align="right" valign="top" class="table-border-bottom"><a href="#" target="_self"><img src="images/go2-button.png" alt="GO!" name="Go2" width="38" height="33" border="0" id="Go2" /></a></td>
</tr>
<tr>
<td colspan="2" align="center"><p class="style1">Clients Check E-mail Here:</p>
<a href="http://mypage.com/webmail/default.aspx" target="_self" onmouseover="MM_swapImage('Go3','','images/go-rollover.png',1)" onmouseout="MM_swapImgRestore()"><img src="images/go-button.png" alt="GO!" name="Go3" width="100" height="100" border="0" id="Go3" /></a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
How can i get this to have a display that shows the online status while the page is being viewed?
Thanks for your help.