Skip to content

Commit 30cbdcd

Browse files
committed
rename status variable to statusElem, so it doesnt conflict with window.status
1 parent 1841e4a commit 30cbdcd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

demos/nav-online.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<p>A timer is constantly polling the navigator.onLine property, which is typically switched via File -&gt; Work Offline</p>
55
</article>
66
<script>
7-
var status = document.getElementById('status')
7+
var statusElem = document.getElementById('status')
88

99
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';
1212
}, 250);
1313
</script>

demos/offline.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<ol id="state"></ol>
55
</article>
66
<script>
7-
var status = document.getElementById('status'),
8-
state = document.getElementById('state');
7+
var statusElem = document.getElementById('status'),
8+
state = document.getElementById('state');
99

1010
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';
1313
state.innerHTML += '<li>New event: ' + event.type + '</li>';
1414
}
1515

0 commit comments

Comments
 (0)