日期:2014-05-17 浏览次数:20404 次
[color=#FF0000]var ActionItemModule = (function () {[/color] var newAIID = 0; //new action item id var dataReadyFlag = false; return { [color=#FF0000] setData:[/color] function (data) { setActionItems(data["actionitems"]); }, [color=#FF0000]getData:[/color] function () { return getActionItems(); }, [color=#FF0000] validateData:[/color] function () { return checkActionItems(); }, addRow: function () { addActionItem(); }, removeRow: function () { removeActionItem(); }, setWorkMode: function (mode) { if (!dataReadyFlag) { setTimeout("ActionItemModule.setWorkMode('" + mode + "')", 500); return; } doSetWorkMode(mode); } };
打个比方: var jQuerys = (function () { return { setData: function () { alert("11111") } } })(); alert(jQuerys.setData()); //你看下 这个就可以好理解啦吧