Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2101 closed defect (fixed)

JavaScript error on login page

Reported by: Nicklas Nordborg Owned by: everyone
Priority: minor Milestone: BASE 3.11.2
Component: web Version:
Keywords: Cc:


The error log shows the following on the login page:

TypeError: element is null


TypeError: element is null main-2.js:866:7

Doesn't seem to affect functionality.

Change History (3)

comment:1 by Nicklas Nordborg, 7 years ago

Hmmm... it seems like the source of the error is the footnote frame. For some reason a DOMContentLoaded event is fired but the document.body element is null.

The problem seems also to be related to the AdBlock plugin. If the plug-in is disabled the errors go away.

Additional investigations indicate that the problem is also related to the location.reload() call from the login page. The reload is there so that the footnote page is updated if a user logs out (since it may contain personal data). Skipping the reload or delaying it for a second also seems to get rid of the problem. Could it be that the call to location.reload() triggers a premature DOMContentLoaded event before the DOM is actually loaded? It could be that AdBlock is causing the DOM to take longer to load?

So, I think we should add a short delay before reloading the footnote page and that we should check the document.body before trying to use it.

comment:2 by Nicklas Nordborg, 7 years ago

Resolution: fixed
Status: newclosed

(In [7421]) Fixes #2101: JavaScript error on login page

comment:3 by Nicklas Nordborg, 7 years ago

Not part of this ticket!! (In [7423]) Fixes #2102: Content security policy violations should not be reported to the server

Last edited 7 years ago by Nicklas Nordborg (previous) (diff)
Note: See TracTickets for help on using tickets.