开发者

"Editing" user text on the fly?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜