3

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?

wowkin2
  • 5,895
  • 5
  • 23
  • 66
gtopal
  • 544
  • 1
  • 9
  • 35

3 Answers3

2

From commit into Django framework "Fixed #28536 -- Removed old JS cross-browser utilities" you can see that there were changes in that file.

Try to run command that will refresh all static files:

python manage.py collectstatic

wowkin2
  • 5,895
  • 5
  • 23
  • 66
0

The problem is 'addEvent' is not defined previously.

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

-1

Maybe you should write

window.addEventListener("load", ...
strdr4605
  • 3,796
  • 2
  • 16
  • 26