Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #16 from paulirish/master

rename status variable to statusElem, so it doesnt conflict with window.status
  • Loading branch information...
commit c6ac81ed9276e1f42b38f64f829314e0290d87a9 2 parents 1841e4a + 30cbdcd
@remy authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 demos/nav-online.html
  2. +4 −4 demos/offline.html
View
6 demos/nav-online.html
@@ -4,10 +4,10 @@
<p>A timer is constantly polling the navigator.onLine property, which is typically switched via File -&gt; Work Offline</p>
</article>
<script>
-var status = document.getElementById('status')
+var statusElem = document.getElementById('status')
setInterval(function () {
- status.className = navigator.onLine ? 'online' : 'offline';
- status.innerHTML = navigator.onLine ? 'online' : 'offline';
+ statusElem.className = navigator.onLine ? 'online' : 'offline';
+ statusElem.innerHTML = navigator.onLine ? 'online' : 'offline';
}, 250);
</script>
View
8 demos/offline.html
@@ -4,12 +4,12 @@
<ol id="state"></ol>
</article>
<script>
-var status = document.getElementById('status'),
- state = document.getElementById('state');
+var statusElem = document.getElementById('status'),
+ state = document.getElementById('state');
function online(event) {
- status.className = navigator.onLine ? 'online' : 'offline';
- status.innerHTML = navigator.onLine ? 'online' : 'offline';
+ statusElem.className = navigator.onLine ? 'online' : 'offline';
+ statusElem.innerHTML = navigator.onLine ? 'online' : 'offline';
state.innerHTML += '<li>New event: ' + event.type + '</li>';
}
Please sign in to comment.
Something went wrong with that request. Please try again.