mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Trigger error checking onload
This commit is contained in:
parent
dec0c731bc
commit
edf8194603
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user