开发者

ReadOnly content in jwysiwyg editor

开发者 https://www.devze.com 2023-01-30 19:17 出处:网络
I was wondering if there is a way to protect a piece of html or text inside the jquery inline content editor jwysiwyg?

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开发者_如何学Python.

Any ideas?

Thanks!


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/)


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);

0

精彩评论

暂无评论...
验证码 换一张
取 消