<html>
<body ononline="onFunction()" onoffline="offFunction()">
<p>打开“文件”菜单并单击“离线工作”以在在线和离线工作之间切换。</p>
<p><strong>注意:</strong> ononline 和 onoffline 事件仅在 Firefox 和 Internet Explorer 版本 8 到 10 中受支持。</p>
<script>
function onFunction() {
alert ("您的浏览器在线工作。");
}
function offFunction() {
alert ("您的浏览器正在离线工作。");
}
</script>
</body>
</html>