So I have this code:
var bindAll; bindAll = function () { $(\'#somediv\').bind(\'mouseover\', function(){do something}); }; var init; init = function () {
just pass init without parenthesis into the ready function. it is being executed immediately in your case and not on document ready:
$(document).ready(init);