Skip to content

Commit

Permalink
rename status variable to statusElem, so it doesnt conflict with wind…
Browse files Browse the repository at this point in the history
…ow.status
  • Loading branch information
paulirish committed Sep 9, 2011
1 parent 1841e4a commit 30cbdcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions demos/nav-online.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
8 changes: 4 additions & 4 deletions demos/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
}

Expand Down

0 comments on commit 30cbdcd

Please sign in to comment.