简体   繁体   English

控件内的HTML代码:ComboBox,TextArea

[英]HTML code inside controls: ComboBox, TextArea

I'm looking for a way to display full HTML in the components (like ComboBox - Select, TextArea) on a web page. 我正在寻找一种在网页上的组件(例如ComboBox-Select,TextArea)中显示完整HTML的方法。 Is it somehow possible to do with the native HTML controls, ex. 例如,是否可以使用本地HTML控件。 extending them? 扩展他们? Are there any extensions that would be useful for me? 有没有对我有用的扩展?

Thanks, Rafal 谢谢,拉法尔

Take a look at how CKEditor renders it's view on the client - it's effectively an Rich Text Editor for browsers (there's lots of other alternatives, too): 看一下CKEditor如何在客户端上呈现它的视图-它实际上是浏览器的RTF编辑器(也有很多其他替代品):

http://ckeditor.com/demo http://www.kevinroth.com/rte/demo.htm http://developer.yahoo.com/yui/examples/editor/index.html http://ckeditor.com/demo http://www.kevinroth.com/rte/demo.htm http://developer.yahoo.com/yui/examples/editor/index.html

Looking at the construction of these with the IE Developer Toolbar, Firebug etc is a real learning experience. 使用IE Developer Toolbar,Firebug等查看这些文件的构造是一种真正的学习体验。

An approach many people take is to embed their text area in a div, and also have a another div that's hidden. 许多人采用的方法是将其文本区域嵌入到div中,并且还隐藏另一个div。 Underneath, are tabs, for example, Editor, Preview. 下面是选项卡,例如“编辑器”,“预览”。 Clicking on preview takes the HTML in the text box and does something like previewDiv.innerHTML = textbox.value; 单击预览会在文本框中获取HTML,并执行诸如楼前楼PreviewDiv.innerHTML = textbox.value;之类的操作。

I'm not sure if this is the kind of thing you want, but an example of this is here: 我不确定这是否是您想要的那种东西,但是这里有一个例子:

http://www.freetextbox.com/demos/ http://www.freetextbox.com/demos/

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM