I have the following code:
$(document).ready(function() {
var refresh = function() {
alert('doing!');
}
}
How to call refresh() function outside the $(document).ready()? Anywhere in the jQuery functions?
eg.
$('#el').click() {
document.ready().refresh();
}
There isn’t a way to call a method defined in a more local scope from another, you have to either store a reference to it, or declare it at/in a higher scope, for example:
Or: