Node.js domain模块用于拦截未处理的错误。 可以使用内部绑定或外部绑定拦截这些未处理的错误。 如果根本没有处理错误,那么它们只会使Node应用程序崩溃。 Internal Binding - 错误发射器正在域的run方法中执行其代码。 External Binding - 使用其add方法将错误发射器显式添加到域。 可以使用以下语法导入此模块。 var domain = require
前面介绍了很多眼花缭乱的新技术,关于渲染,关于硬件加速,关于布局,关于其他很多,同大家一样,我也花了很多时间来消化它们。本章介绍稍微基础些的话题(本系列的写作顺序完全是随心所欲地),就是在渲染整个过程的初始阶段---HTML解析。不过这不表示它简单,其实这里是非常绕人的。在前面描述渲染过程,其实也是回避了这些方面的很多细节,原因也很简单,我自己也没有完全仔细地了解清楚. :-( 现在又重新阅读和d
DOM是Document Object Model的缩写,翻译过来叫文档对象模型,但我觉得这个听起来很生疏,不如还是直接叫DOM,所以本节的标题就定为了DOM简述。由于Chrome扩展应用使用HTML渲染界面,所以不可避免地要接触DOM。考虑到并非所有读者都编写过HTML,我决定单独拿出一小节来讲解DOM,帮助这些读者快速入门。当然,用短短的一节是无法讲透的——毕竟DOM可以写另外一本书了——这里
Examples var parser = new tinymce.html.DomParser({validate: true}, schema); var rootNode = parser.parse('<h1>content</h1>'); Methods name summary defined by addAttributeFilter() Adds a attribute filte
Examples var walker = new tinymce.dom.TreeWalker(startNode); do { console.log(walker.current()); } while (walker.next()); Methods name summary defined by current() Returns the current node. tinym
Methods name summary defined by addAttributeFilter() Adds a attribute filter function to the parser used by the serializer, the parser will collect nodes that has the specified attributes and then exe
Examples // Getting the currently selected node for the active editor alert(tinymce.activeEditor.selection.getNode().nodeName); Constructors name summary defined by Selection() Constructs a new select
Examples // Load a script from a specific URL using the global script loader tinymce.ScriptLoader.load('somescript.js'); // Load a script using a unique instance of the script loader var scriptLoader
Methods name summary defined by compareRanges() Compares two ranges and checks if they are equal. tinymce.dom.RangeUtils getCaretRangeFromPoint() Gets the caret range for the given x/y location. tinym
Methods name summary defined by bind() Binds a callback to an event on the specified target. tinymce.dom.EventUtils clean() Removes all bound event listeners for the specified target. This will also r
Examples // Add a class to an element by id in the page tinymce.DOM.addClass('someid', 'someclass'); // Add a class to an element by id inside the editor tinymce.activeEditor.dom.addClass('someid', '
Examples var $ = tinymce.dom.DomQuery; $('p').attr('attr', 'value').addClass('class'); Properties name type summary defined by context Element Context used to create the set. tinymce.dom.DomQuery leng
Can't find what you're looking for? Let us know. Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under th
Constructors name summary defined by BookmarkManager() Constructs a new BookmarkManager instance for a specific selection instance. tinymce.dom.BookmarkManager Methods name summary defined by getBookm
Examples // Load a script from a specific URL using the global script loader tinymce.ScriptLoader.load('somescript.js'); // Load a script using a unique instance of the script loader var scriptLoader