简体   繁体   English

tinymce 4加载,但显示tinymce.get是未定义的

[英]tinymce 4 loading but showing tinymce.get is undefined

I'm working in a form update section using Tinymce and jquery and using ejs for load form including textarea and i call tinymce (tinymce init) using JavaScript function right after the ejs loaded. 我正在使用Tinymce和jquery在表单更新部分中工作,并使用ejs加载包括textarea的表单,并且在ejs加载后立即使用JavaScript函数调用tinymce(tinymce init)。 The editor is working fine, but when i use 编辑器工作正常,但是当我使用时

tinymce.get("content-text").setContent( $(".grid:first").html() );

for set content to editor its showing error. 用于设置内容以编辑其显示错误。 if i load the textarea form and load tinymce again it will work ;) I don't what is happening here. 如果我加载textarea表单并再次加载tinymce它将起作用;)我不在这里发生什么。

根据您的评论,我建议您在$(document).ready()并在html表单之前实例化tinymce。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM