I am trying to remove dependence on jQuery. I have stolen a couple of functions I needed from underscore.js, but still need my code to run after the DOM is loaded in the same way as jQuery
Original
$(function(){
// all my code
})
Desired
var afterload = function(content){
// what goes here..?
}
afterload(function(){
// my code that should run after the DOM is loaded
})
There is a nice solution from https://github.com/freelancephp/DOMReady,
Here is a script
and you can use like this