Error conditions

suggest change

Most browsers, when configured to block cookies, will also block localStorage. Attempts to use it will result in an exception. Do not forget to manage these cases.

var video = document.querySelector('video')
try {
    video.volume = localStorage.getItem('volume')
} catch (error) {
    alert('If you\'d like your volume saved, turn on cookies')
}
video.play()

If error were not handled, program would stop functioning properly.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Web Storage:
*Error conditions

Table Of Contents
16Map
17Set
43Web Storage