Skip to content

Commit 1b1a2c4

Browse files
committed
minor fixes
1 parent 2957e71 commit 1b1a2c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

2-ui/5-loading/01-onload-ondomcontentloaded/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The example below correctly shows image sizes, because `window.onload` waits for
114114

115115
```html run height=200 refresh
116116
<script>
117-
window.onload = function() {
117+
window.onload = function() { // can also use window.addEventListener('load', (event) => {
118118
alert('Page loaded');
119119
120120
// image is loaded at this time

6-data-storage/02-localstorage/article.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ If both windows are listening for `window.onstorage`, then each one will react o
202202

203203
```js run
204204
// triggers on updates made to the same storage from other documents
205-
window.onstorage = event => {
205+
window.onstorage = event => { // can also use window.addEventListener('storage', event => {
206206
if (event.key != 'now') return;
207207
alert(event.key + ':' + event.newValue + " at " + event.url);
208208
};

0 commit comments

Comments
 (0)