Skip to content
This repository
Browse code

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 Sharp authored

Showing 2 changed files with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +3 3 demos/nav-online.html
  2. +4 4 demos/offline.html
6 demos/nav-online.html
@@ -4,10 +4,10 @@
4 4 <p>A timer is constantly polling the navigator.onLine property, which is typically switched via File -&gt; Work Offline</p>
5 5 </article>
6 6 <script>
7   -var status = document.getElementById('status')
  7 +var statusElem = document.getElementById('status')
8 8
9 9 setInterval(function () {
10   - status.className = navigator.onLine ? 'online' : 'offline';
11   - status.innerHTML = navigator.onLine ? 'online' : 'offline';
  10 + statusElem.className = navigator.onLine ? 'online' : 'offline';
  11 + statusElem.innerHTML = navigator.onLine ? 'online' : 'offline';
12 12 }, 250);
13 13 </script>
8 demos/offline.html
@@ -4,12 +4,12 @@
4 4 <ol id="state"></ol>
5 5 </article>
6 6 <script>
7   -var status = document.getElementById('status'),
8   - state = document.getElementById('state');
  7 +var statusElem = document.getElementById('status'),
  8 + state = document.getElementById('state');
9 9
10 10 function online(event) {
11   - status.className = navigator.onLine ? 'online' : 'offline';
12   - status.innerHTML = navigator.onLine ? 'online' : 'offline';
  11 + statusElem.className = navigator.onLine ? 'online' : 'offline';
  12 + statusElem.innerHTML = navigator.onLine ? 'online' : 'offline';
13 13 state.innerHTML += '<li>New event: ' + event.type + '</li>';
14 14 }
15 15

0 comments on commit c6ac81e

Please sign in to comment.
Something went wrong with that request. Please try again.