I have this code:
(function ($) {
$(document).ready(function() {
test("hola","caracola");
});
function test(somevar1, somevar2)
{
alert(somevar1+ "" + somevar2);
}
}(jQuery));
function atest2(somevar1, somevar2)
{
test(somevar1+ "" + somevar2);
}
when executing test2 function the result is:
ReferenceError: test is not defined
My question is:
How can I call test2 to execute correctly jQuery's inner test function?
Thanks
testoutside of the anonymous function.test()outside of the jQuery load function, and still use it from within.