bullet icon indicating copy to clipboard operation
bullet copied to clipboard

TypeError: document.getElementById(...) is null

Open afdev82 opened this issue 6 years ago • 1 comments

I get the following error if I close the footer and do something that triggers the bullet functionality again (I do a request to the server):

TypeError: document.getElementById(...) is null

I think the responsible line is:

var oldHtml = document
            .getElementById('bullet-footer')
            .innerHTML.split('<br>');

If the bullet footer stays open, I don't have any error. I just updated to v6.0.0, before it was fine with v5.9.0.

afdev82 avatar May 02 '19 15:05 afdev82

This error TypeError: document.getelementbyid(...) is null would seem to indicate that there is no such element with an ID passed to getElementById() exist. This can happen if the JavaScript code is executed before the page is fully loaded, so its not able to find the element. The solution is that you need to put your JavaScript code after the closure of the HTML element or more generally before < /body > tag.

linehammer avatar Nov 09 '21 05:11 linehammer