It is impossible to call a method defined in a more local scope from another, you need to either save a link to it or declare it in / in a higher scope, for example:
$(document).ready(function() {
window.refresh = function() {
alert('doing!');
};
});
Or:
var refresh = function() {
alert('doing!');
};
$(document).ready(function() {
});
source
share