Which event is best for running window.onload scripts, via jQuery or through what?
.
document.addEventListener('DOMContentLoaded', function(){...}, false); // не кроссбраузерно
Source: https://ru.stackoverflow.com/questions/161063/