开发者

"Editing" user text on the fly?

开发者 https://www.devze.com 2023-02-20 16:07 出处:网络
I would like to implements something like vBullettin (or stackoverflow) does. When the user clicks \"edit\" the HTML text is converted to plain text into a <textarea></textarea> ready for

I would like to implements something like vBullettin (or stackoverflow) does. When the user clicks "edit" the HTML text is converted to plain text into a <textarea></textarea> ready for the editing.

How would you implemeent something like that? Note I can use jQuery.

I would like especially know the authentication part (if users clicks "edit" on soemone else开发者_运维百科 comments there is a warning)

Thanks


Check out this jQuery plugin for inline editing

http://www.appelsiini.net/projects/jeditable


How about using the built in contentEditable property? I think it's a bit cleaner than having to switch out the text for an input element. It's supported in IE6/7/8, Firefox, Safari, Chrome and Opera.

jQuery example: http://valums.com/files/2009/editableText/demo/demo.htm

0

精彩评论

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