Remove window.onload. Considering using a requirejs plugin instead.