You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run your script in head I get the following error: TypeError: document.body is null
To fix this you have to put the js code below the body tag. Is there any other fix to have the js in the head section? This appears in firefox and chrome.
The text was updated successfully, but these errors were encountered:
This kind of issue often happen when you're trying to interact with the DOM when it is not properly loaded (i.e. too soon).
You can add an event listener in order to wait until the DOM is fully loaded before interact with it.
You can use $.ready(function(){/* your code here */}) with jquery or document.addEventListener('DOMContentLoaded', function(){/* your code here */}) in native javascript.
Thus, your javascript code will wait the end of the page load to add your notification system.
When I run your script in head I get the following error:
TypeError: document.body is null
To fix this you have to put the js code below the body tag. Is there any other fix to have the js in the head section? This appears in firefox and chrome.
The text was updated successfully, but these errors were encountered: