设置内容功能返回[对象对象]

发布于 2025-02-05 02:13:27 字数 336 浏览 2 评论 0原文

我正在使用此脚本来获取Tinymce的内容:

let editorContent;
editorContent.set(tinymce.get("firstEditor").getContent());

收到内容后,我将其作为字符串值保存到我的数据库中。 在需要时,我希望能够检索值并将其显示在同一Tinymce编辑器中。我尝试使用下面的脚本来做到这一点,但最终显示了[对象对象] ..

tinymce.get("firstEditor").setContent(editorContent);

是否有人知道可能导致此问题的原因?

I'm using this script to get the content of TinyMCE:

let editorContent;
editorContent.set(tinymce.get("firstEditor").getContent());

After receiving the content, I save it to my database as a string value.
When needed I want to be able to retrieve the value and display it in the same TinyMCE editor. I tried using the script below to do so but that ends up displaying [object Object]..

tinymce.get("firstEditor").setContent(editorContent);

Does anybody have some clue to what could cause this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暮色兮凉城 2025-02-12 02:13:27

我在字符串变量上使用“ .get()”来启动解决方案!

因此,我不是:

tinymce.get("firstEditor").setContent(editorContent);

我使用此命令:

tinymce.get("firstEditor").setContent(editorContent.get());

I fount the solution, using ".get()" on the string variable worked!

So instead of:

tinymce.get("firstEditor").setContent(editorContent);

I used this command:

tinymce.get("firstEditor").setContent(editorContent.get());
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文