触发 online
属性事件当浏览器开始在线工作时。
online
属性是HTML5中的新特性。
<element ononline="script or Javascript function name">
<body>
ononline |
No | 8.0 | Yes | No | No |
<!DOCTYPE html>
<html>
<body ononline="onFunction()" onoffline="offFunction()">
<p>Open the File menu and click on "Work Offline" to
toggle between working online and offline.</p>
<script>
function onFunction() {
alert ("online.");
}
function offFunction() {
alert ("offline.");
}
</script>
</body>
</html>