Ich hatte Code mit mir, um die Internetverbindung zu überprüfen und auch den Online-/Offline-Status in Label in der Zeit des HTML-Seitenladevorgangs anzuzeigen. aber es funktioniert nicht richtig. Also bitte hilf mir das Problem zu lösen. Hier ist das Skript um die Internetverbindung zu überprüfen.wie check internet verbindung und display in label in html?
enter code here
<script type="text/javascript">
function checkconnection() {
var status = navigator.onLine;
if (status) {
document.getElementById("LblText").value = "ONLINE";
}
else
{
document.getElementById("LblText").value = "OFFLINE";
}
}
</script>
i am also attaching label syntax below`
enter code here`
<label id="LblText">NO Text</label>
i want to show label text online /offline according to internet connection availability.
Mögliche Duplikat [Überprüfen Sie, ob Internet-Verbindung mit Javascript Exists?] (Http://stackoverflow.com/questions/2384167/check-if-internet-connection-exists-with-javascript) – Iceman
Mögliche Duplikat [Erkennen, dass die Internetverbindung offline ist?] (Http://stackoverflow.com/questions/189430/detect-that-the-internet-connection-is-offline) – Vidur