Compatibility between browsers should depend on how you define the term “browser”. For example, if it is a text browser, perhaps this is not what you are looking for.
To answer your question, it will be cross-browser compatible if that particular browser guarantees the window.onload function.
As a general guide, we usually use tested libraries to allow libraries to take care of such cross-browser compatibility, and we are dealing with real application logic.
Hope this helps!
source
share