Home » Education » How to Fix the cannot [x] of null JavaScript Error JS1

How to Fix the cannot [x] of null JavaScript Error JS1

Written By Zen on Friday, May 21, 2021 | 07:00 PM

 
In this video we will be looking at the two main culprits of, and how to fix, the cannot [x] of null error in JavaScript where [x] can be anything such as adding an Event Listener or trying to access a property of a JavaScript Object and their solutions. Links: video files: http://tiny.cc/xofnull getting started series link: https://youtube.com/playlist?list=PLAchoaeVaQJj37FWV_vypQmjGmOGlDu90 Chapters: 0:00 Video Start 0:40 Basic House Keeping 1:12 The 2 main causes of the error 2:22 The old style of setting event handlers 2:54 The basic referencing errors (Pre DOM) 3:55 Fixing the references 4:50 Explaining the DOM error 7:25 Fixing the DOM error 8:20 Arrow function Alternative 8:50 load vs DOMContentLoaded 10:17 The event variable 12:15 The common referencing error 13:12 Fixing the common referencing error (and how to find it) 15:41 Video wrap up