晕,请搜索 web编辑器基本原理!百度,google 上多滴很!
解决方案 »
- 关于正则表达式的问题
- 请高人指点 表单处理
- 如何获取iframe里页面被卷去的高度
- js脚本在FF浏览器上不起作用了?
- How to open a target new window in current page? Thanks a lot!
- 如何修改梅花雨日历程序,使其只可以选择今日和未来两周的日期,其他的都不可选?
- 用createPopup创建的窗体show出来之后,如何捕获他的隐藏事件
- 相同的name,不同的value,怎么用javascript来实现选择提示???谢谢各位兄弟。
- 我在写javascript函数的时候,用try 和 catch 时 怎么老是提示出错啊??
- 小问题,那位大虾快来回答..
- 参数传递问题!
- js如何从一个日期中减掉几个小时
<div contenteditable=true></div>就可以写东西了
用对于iframe 需要用javascript设置起Oneditable=true就可以了.至于效果就是改变div或iframe的innerHTML就可以了.只是一点,你自己去查一查相关的资料吧
但通常的web编辑器不是textarea, 而是designMode=on的iframe:
---------
<font color=red>fdafdsafdsafdsaf</font>
<iframe id=aaa src="about:blank">
</iframe>
<script>
document.getElementById("aaa").contentWindow.document.designMode="On";
</script>
{
temp = temp.Replace("<", "<");
temp = temp.Replace(">", ">");
temp = temp.Replace("'", "<|>");
temp = temp.Replace("\n", "<br>");
//temp = temp.Replace("\r", "<br>");
temp = temp.Replace(" ", " "); return temp;
}