mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
32 lines
625 B
HTML
32 lines
625 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
|
|
<script src="../vendor/offline/offline.min.js"></script>
|
|
</head>
|
|
<body onload="offline()">
|
|
|
|
<div id="test">NULL</div>
|
|
<script>
|
|
function offline(){
|
|
Offline.options = { checkOnLoad: true, reconnect: true, requests: false };
|
|
Offline.check();
|
|
|
|
Offline.on('up down', updateState );
|
|
}
|
|
|
|
function updateState(){
|
|
|
|
if(Offline.state === 'up'){
|
|
document.getElementById("test").innerHTML = "UP";
|
|
}
|
|
else{
|
|
document.getElementById("test").innerHTML = "DOWN";
|
|
}
|
|
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html> |