navigator.onLine
オンライン作業中かオフライン作業中かを返します。trueであればオンライン、falseであればオフラインとなります。ただし、この結果はInternet Explorerのファイルメニュー内のオフライン作業の項目にチェックが入っているかどうかを示すものになります。つまり、実際にネットワークに接続されているかどうかを調べることはできません。 このプロパティはWindows版Internet Explorer 4以降、Macintosh版Internet Explorer 5、iCab 3以降で利用できます。
構文
navigator.onLine
例文
<html> <head> <title>navigator.onLine</title> <script type="text/javascript"><!-- window.onload = function() { var flag = navigator.onLine; document.getElementById("result").innerHTML = flag; } // --></script> </head> <body> <div id="result"></div> </body> </html>
関連記事
- navigator.vendorSub
- navigator.vendor
- navigator.userProfile
- navigator.userLanguage
- navigator.userAgent
- navigator.taintEnabled
- navigator.systemLanguage
- navigator.securityPolicy
- navigator.productSub
- navigator.product
- navigator.preference
- navigator.platform
- navigator.oscpu
- navigator.opsProfile
- navigator.language
- navigator.javaEnabled
- navigator.cpuClass
- navigator.cookieEnabled
- navigator.browserLanguage
- navigator.appVersion
- navigator.appName
- navigator.appMinorVersion
- navigator.appCodeName
スポンサーリンク