Is it possible to use the sandbox javascript module from DOM manipulation? Example fo
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 */ } });
I suggest reading this slidedeck in an application , Sandbox, and Module in Slideshare called Creating a JavaScript Module for JavaScript in Gilt .
, : , . , Core.publicApi document . , , Javascript, .
Core.publicApi
document
, , window:
window
var window = {"Core": Core};
no ( , alert) . , , API.
alert
(, _unsandboxed - ) window, API . , , , _unsandboxed.
_unsandboxed
Source: https://habr.com/ru/post/1735723/More articles:SSRS 2008 / Visual Studio 2010 ReportViewer always shows the first page of a report - reporting-servicesMux & Demux w / LINQ - linqClass Link for Parents - c ++android: set menu left / right - androidOpen menu options through code - androidConnection from host to virtual server fails with inaccessible network from Java - javaHow to remove all html tags in javascript with exceptions? - javascriptto safely separate html tags in javascript using whitelist - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1735727/trying-to-understand-bzr-repository-ii&usg=ALkJrhjVIZKMu74-ejYFdxrqHTw2LsWXYwjavascript replace allowed html tags - javascriptAll Articles