HTML DOM onLine 屬性
定義和用法
onLine 屬性是一個只讀的布爾值,聲明了系統(tǒng)是否處于脫機模式。
注釋:在 IE 4+ 中,用戶可以在瀏覽器中選擇脫機工作的狀態(tài)。當脫機工作被選后,系統(tǒng)就進入了脫機狀態(tài),內(nèi)容將從緩存進行讀取。
語法
navigator.onLine
實例
<html>
<body>
<script type="text/javascript">
document.write("<p>OnLine: ")
document.write(navigator.onLine
+ "</p>")
</script>
</body>
</html>