Trigger error checking onload

This commit is contained in:
remy 2011-02-19 19:59:34 +00:00
parent dec0c731bc
commit edf8194603

View File

@ -64,8 +64,7 @@ window.jsbin = {};
}
});
$(document).bind('codeChange', throttle(function () {
var checkForErrors = function () {
var jshint = jsbin.jshint(),
errors = '';
@ -76,7 +75,10 @@ window.jsbin = {};
errors = errors == 1 ? '1 error' : errors + ' errors';
$error.text('(' + errors + ')').show();
}
}, 1000));
};
$(document).bind('codeChange', throttle(checkForErrors, 1000));
$(document).bind('jsbinReady', checkForErrors);
}).call(jsbin);
function throttle(fn, delay) {