Consider the following javascript:
$(function(){
var private_function = function(){
alert("private_function!");
}
setTimeout("private_function();", 1000);
});
This gives the error "private_function not defined".
Is there a way to delay the execution of a private / anonymous function in javascript without polluting the global namespace and not opening it through the global module?
Thanks for any suggestions.
source
share