function AddText(FormName,Name,NewCode){
document.FormName.Name.value+=NewCode
}
function bold()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function incline()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function underline()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function showcolor(a)
{
if (document.selection && document.selection.type == "Text" && a!="默认")
{var range = document.selection.createRange();
range.text = "[color:'"+a+"']" + range.text + "[/color]";
}
}
function cfs(b)
{
if (document.selection && document.selection.type == "Text" && b!="默认")
{var range = document.selection.createRange();
range.text = "[size:'"+b+"']" + range.text + "[/size]";
}
}
function center()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "[center]" + range.text + "[/center]";
}
}
function dq(c)
{
if (document.selection && document.selection.type == "Text" && c!="默认")
{var range = document.selection.createRange();
range.text = "[$parab:"+c+"$]" + range.text + "[$/parab$]";
}
}
function dh(d)
{
if (document.selection && document.selection.type == "Text" && d!="默认")
{var range = document.selection.createRange();
range.text = "[$para:"+d+"$]" + range.text + "[$/para$]";
}
}
document.FormName.Name.value+=NewCode
}
function bold()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function incline()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function underline()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "" + range.text + "";
}
}
function showcolor(a)
{
if (document.selection && document.selection.type == "Text" && a!="默认")
{var range = document.selection.createRange();
range.text = "[color:'"+a+"']" + range.text + "[/color]";
}
}
function cfs(b)
{
if (document.selection && document.selection.type == "Text" && b!="默认")
{var range = document.selection.createRange();
range.text = "[size:'"+b+"']" + range.text + "[/size]";
}
}
function center()
{
if (document.selection && document.selection.type == "Text")
{var range = document.selection.createRange();
range.text = "[center]" + range.text + "[/center]";
}
}
function dq(c)
{
if (document.selection && document.selection.type == "Text" && c!="默认")
{var range = document.selection.createRange();
range.text = "[$parab:"+c+"$]" + range.text + "[$/parab$]";
}
}
function dh(d)
{
if (document.selection && document.selection.type == "Text" && d!="默认")
{var range = document.selection.createRange();
range.text = "[$para:"+d+"$]" + range.text + "[$/para$]";
}
}
解决方案 »
- 高手来吧!求解!
- javascript中 关于 substring 参数的问题
- 菜鸟想详细了解document.body.offsetHeight
- 求非基于frameset的布局
- 如何做出点击图片,图片居中,其他部分阴影显示
- javascript 支持线程安全吗?
- 有没有办法用javascript对图象进行切割
- new ActiveXObject 提示错误:Automation server can't create object
- 不用window.open()和window.showModalDialog(),怎么隐藏工具栏和地址栏?
- 怎么把一个集合添加到另一个集合中?
- 请问如何用javascript清楚IE中的authorization头?在线等待.....
- XMLDOM,XMLHTTP取来的东西总被IE缓冲!
都是一些正则表达式匹配:比如aaaa
var re = /\[b\]([^\[\]]+)[\[\/b\]]/gi;
str = str.replace(re, "<b>$1</b>");
找到这个.但发现有错:
只能替换成aaaa/b]