Here is my jquery code and it does not work. I really dont know why. Please help and also tell me how can I fix it.
$(function () {
var panel = function () {
var init = function () {
console.log('hello');
};
return {
init: init
}
};
$('.nav li a').on('click', function (e) {
panel.init();
});
})();
I am getting this error in my console
Object function () {
var panel = function () {
var init = function () {
console.log('hello');
}
};
return {
init: init
}
} has no method 'init'
I think you are missing the parentheses off of the end of the panel function declaration.
Make sure the closing brace is followed by
()