javascript - How to get a reference to a Module? -
i trying encapsulate code using module pattern. problem can't reference it. following error
message: 'plannertab.getconfig' null or not object line: 14 char: 5 code: 0
code
/* document ready */ $(function () { /* config */ var config = plannertab.getconfig; }); /* module */ var plannertab = (function () { var config = { tableid: '#plannertable' }; return { getconfig: config }; })();
you're victim of automatic semicolon insertion.
this:
return { getconfig: config };
should written like:
return { getconfig: config };
Comments
Post a Comment