沙箱的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