I'm having trouble figuring out why the following is not working:
My custom JS library
(function ($, undefined) {
var expenses = expenses || {};
expenses.report = function () {
var deleteReport = function () {
alert('test');
};
return {
deleteReport: deleteReport
};
};
window.expenses = expenses;
})(jQuery);
How I am calling it on the page:
$(function() { expenses.report.deleteReport() };
The error:
Uncaught TypeError: Object function () {
var deleteReport = function () {
alert('test');
};
return {
deleteReport: deleteReport
};
} has no method 'deleteReport'
I'm still familiarizing myself with javascript and jquery so I'm sure there is something simple in the design that I am leaving out. I just can't figure out what it is.