웹 브라우저가 오프라인으로 작동하기 시작하면 온오프라인 속성 트리거. 다음 코드를 실행하여 onoffline을 구현할 수 있습니다. 속성 -
예시
<!DOCTYPE html>
<html>
<body ononline = "onlineFunc()" onoffline = "offlineFunc()">
<script>
function onlineFunc() {
alert ("Working online!");
}
function offlineFunc() {
alert ("Workinf offline!");
}
</script>
<p>Got o the web browser menu bar and click the File menu. Select "Work Offline" and toggle between online and offline.</p>
</body>
</html>