Namespacing is new to me in js - and my project has grown very complex so it's time to tame the beast :-P
I have created a namespace foo in foo.js using the module pattern.
var foo = (function () {
update: function () {
alert('z');
}
};
}());
I can call foo.update in the document ready function on an html page with $(function () {foo.update(); });
But I can't seem to get it to fire calling from another js file.
I am trying to call it from bar.js
function updateTheFoo() {
foo.update();
}
The actual use case is much more complicated, as I'm using it within a dynamically created jQueryUI dialog with variable buttons that are passed code on the fly - but that's the easy part...
I'm sure this is something simple - but I can't seem to find the answer.
Many thanks!