Below is my sample js in which everything is defined inside doDomReady function their are multiple function their. `
YAHOO.namespace("YAHOO.User");
YAHOO.User = (function() {
Event.onDOMReady(UserData = function() {
.......
function save(){}
..........
});
})();`
From the above js file I want to call the save method from outside(from other js file) like this ->YAHOO.User.save(resultset) but I am not able to call it since it is not visible.
Anyone tell me how to call the functions in above case.
window.save == function(resultset){ ... }
This puts it in the global scope, so you could just call save()
from another script. To namespace it under YAHOO.User, I suppose it would be:
window.YAHOO.User.save = function(resultset){ ... }
... then you can call YAHOO.User.save(resultset)
from outside.