I am trying to refactor a big JQuery file into smaller ones, but one of the things is I have to be able to call functions inside another JQuery file, but I cant get it to work. So how do I change this code so I can call someFunction inside File1.js from from File2.js?
//File1.js
(function (s_diary, $, undefined) {
function someFunction()
{
alert("Yay");
}
} (window.s_diary= window.s_diary|| {}, jQuery));
//File2.js
(function (s_one, $, undefined) {
function someFunction()
{
s_diary.someFunction();
}
} (window.s_one= window.s_one|| {}, jQuery));