window.onload function not waiting firefox code example Example: window.onload window.onload = function() { // Some code };