- JScript code
[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); } };
红字部分的这种写法是什么意思??求解答啊!
------解决方案--------------------------------------------------------
- JScript code
打个比方:var jQuerys = (function () { return { setData: function () { alert("11111") } }})();alert(jQuerys.setData());//你看下 这个就可以好理解啦吧