Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将插件集成到 TinyMCE 编辑器。为此,我需要检查 TinyMCE 编辑器是否存在于任何页面中。如果我们能够使用 Javascript 进行检查,那就太好了。只有成功了这一步,我才能往前走。请帮助我尽早找到解决方案。
您可以简单地测试由 tinyMCE 脚本创建的 tinyMCE 全局变量。
好像在ready之前就可以使用,只要你在脚本声明之后。如果您担心脚本被放置在页面底部,请使用 ready 事件。
console.log('tinyMCE exists? ' + (tinyMCE === undefined ? 'NO' : 'YES'));