(function($){
$.a.b = {
title: "ABC",
init: function (id) {
/* do something here */
return id+'a';
}
};
})(jQuery);
When I try to call $.a.b.init('t'); it does not work, I mean it does not return as expected. Any suggestions?
The problem is not that $.a.b.init('t') is not working. Problem is that it returns the code of the whole function instead of returning say a string.
Thank you for your time.
$.a.bthing: jsbin.com/eqaji . Typically, you'll get the source of the function if you don't start it, e.g.alert($.a.b.init);and notalert($.a.b.init('parameter'));, so there isn't much more I can think of without more code.