沙箱的JavaScript模块可以从DOM操作吗?例如沙箱的JavaScript模块
var Core = {
register: function(config){config.init()},
publicApi: {
msgbox: function(msg){alert(msg)}
}
}
Core.register({
name: 'testmodule',
init: function(){
/* from there i want to see only function defined in Core.publicApi, no jQuery direct access, no DOM */
}
});
请不要发布链接的答案。如果你写了一个正确的答案,我会删除我的downvote。 – 2015-01-23 11:04:53