As we were already using jQuery for a graphical eye-candy feature we ended up using this. A code like
$(document).ready(function() {
// any code goes here
init();
});
did everything we wanted and cares about browser incompatibilities at its own.