jwysiwyg 编辑器中的只读内容

发布于 2024-10-07 14:09:09 字数 188 浏览 0 评论 0原文

我想知道是否有一种方法可以保护 jquery 内联内容编辑器 jwysiwyg 中的一段 html 或文本?

例如,我有一个从外部插入到编辑器中的 div,但我不希望用户修改它。

我无法捕获其中的按键事件(iframe 安全性?),并且将 div 设置为只读或禁用不起作用。

有什么想法吗?

谢谢!

I was wondering if there is a way to protect a piece of html or text inside the jquery inline content editor jwysiwyg?

For example, I have a div that I externally insert to the editor and I do not want the user to modify it.

I could not capture the keypress event inside it (iframe security?) and setting the div to readonly or disabled did not work.

Any ideas?

Thanks!

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

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

发布评论

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

评论(2

忆梦 2024-10-14 14:09:09

只需为该 div 添加一个单击事件处理程序,以便它引发警报并禁用(灰显)页面的其余部分;类似登录对话框的东西(查看 jQueryUI 对话框 - http://jqueryui.com/demos/dialog/)

Just add a click event handler for that div so it throws an alert and disables (graying out) the rest of the page; something like a login dialog (check out jQueryUI dialog - http://jqueryui.com/demos/dialog/)

半山落雨半山空 2024-10-14 14:09:09

试试吧!
要清除编辑器中的内容,请使用

$('#wysiwyg').wysiwyg('clear');

如果您想动态设置编辑器的内容,可以使用

$('#wysiwyg').wysiwyg('setContent' response.message);

Try it!
To clear the content in the editor use

$('#wysiwyg').wysiwyg('clear');

If you want to set the content of the editor on the fly you can use

$('#wysiwyg').wysiwyg('setContent' response.message);

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