How can i fix the error Uncaught ReferenceError: addEvent is not defined

Viewed 762

After changing my python and Django version I came up with the error of
Uncaught ReferenceError: addEvent is not defined.

The error took place at my DateTimeShortcuts.js file.

The code raising the error is:

addEvent(window, 'load', DateTimeShortcuts.init);
window.DateTimeShortcuts = DateTimeShortcuts;

This error prevents me for rendering correct a date widget that I am using for my Django app.

Any idea how to handle it?

3 Answers

The problem is 'addEvent' is not defined previously.

Make sure that you have the definition of 'addEvent' imported or written before this line.

Maybe you should write

window.addEventListener("load", ...
Related