所见所得模式与UBB代码模式切换

来源:百度知道 编辑:UC知道 时间:2024/06/16 05:55:57
所见所得模式应该是设置一个<div contenteditable="true"></div>
所见所得模式下的插入的图片格式应该是HTML标签 而且应该替换掉< >
如何与UBB代码模式切换呢?不会是用正则表达式去匹配HTML代码吧 可是已经是替换掉 < >了啊。。。
UBB代码模式应该是个文本域 是最终提交的代码 怎么去获得所见所得模式下的输入呢?
老鸟来点一点。。。谢谢!
你们理解错了
我不是想调用一个编辑器 是想要一个思路 去制作一个编辑器。

添加内容时调用编辑器方法:
<textarea name="content" cols="80" rows="15" id="content" style="display:none</textarea>
<iframe ID="Editor" name="Editor" src="路径/ubb/edit.htm?id=content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:320;width:100%"></iframe>

编辑内容时调用编辑器方法:
<textarea name="content" cols="80" rows="15" id="content" style="display:none"><%=server.htmlencode(content)%></textarea>
<iframe ID="Editor" name="Editor" src="路径/ubb/edit.htm?id=content" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:320;width:100%"></iframe>

显示数据库的内容方法:
1、在要显示的页面包含ubb.asp
2、 ubbcode(server.h