将输入的内容插入到一个DIV里不就行了吗?如果输入了HTML标签也会显示啊

解决方案 »

  1.   

    什么平台啊? 我不知道啊 能不能说下啊~~  代码插入到DIV里面还是代码什么也不变!
      

  2.   

    没有什么技术含量的活就由我做吧,把那个页面扒了下来
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>QQ空间留言代码预览</title>
    <style>
    A.applink:hover {border: 2px dotted #DCE6F4;padding:2px;background-color:#ffff00;color:green;text-decoration:none}
    A.applink       {border: 2px dotted #DCE6F4;padding:2px;color:#2F5BFF;background:transparent;text-decoration:none}
    A.info          {color:#2F5BFF;background:transparent;text-decoration:none}
    A.info:hover    {color:green;background:transparent;text-decoration:underline}
    </style>
    </head><<body>
    <div align="center">
    <br><br><font color="red"><B>把代码复制到下面的方框中 将自动在下方显示留言效果</B></font><br>
    <textarea name="main_editer" cols="99" rows="14" id="main_editer" onSelect="javascript: storeCaret(this);" onClick="javascript: storeCaret(this);" onKeyDown="return ctlent();" onKeyUp="javascript:main_editer_Keyup();"></textarea>
    <P><a href="javascript:getUndo(document.getElementById('main_editer'));" title="快捷键:Ctrl+Z 支持无限级撤销">撤销</a> | <a href="javascript:callclip(main_editer);">复制到剪贴板</a> | <a href="javascript:clearALL();">清空</a></P>
    <script language="javascript">
    function write_style_css(){
    document.writeln("<style type=\"text\/css\">");
    document.writeln("<!--");
    document.writeln(".sp_btn {");
    document.writeln(" BORDER-RIGHT: #7b9ebd 1px solid; ");
    document.writeln(" PADDING-RIGHT: 2px; ");
    document.writeln(" BORDER-TOP: #7b9ebd 1px solid; ");
    document.writeln(" PADDING-LEFT: 2px; ");
    document.writeln(" FONT-SIZE: 12px; ");
    document.writeln(" FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#ACDFF2); ");
    document.writeln(" BORDER-LEFT: #7b9ebd 1px solid; ");
    document.writeln(" CURSOR: hand; ");
    document.writeln(" COLOR: black; ");
    document.writeln(" PADDING-TOP: 2px; ");
    document.writeln(" BORDER-BOTTOM: #7b9ebd 1px solid");
    document.writeln("}");
    document.writeln("body {");
    document.writeln(" font-family: \"宋体\", \"新宋体\", \"黑体\";");
    document.writeln(" font-size: 12px;");
    document.writeln(" margin: 0px;");
    document.writeln("}");
    document.writeln(".con_title {");
    document.writeln(" font-weight: bold;");
    document.writeln("}");
    document.writeln("");
    document.writeln("td {");
    document.writeln(" font-family: \"宋体\", \"新宋体\", \"黑体\";");
    document.writeln(" font-size: 12px;");
    document.writeln("}");
    document.writeln(".border_color {");
    document.writeln(" border: 1px solid #ACDFF2;");
    document.writeln("}");
    document.writeln(".main_table {");
    document.writeln(" border: 1px solid #ACDFF2;");
    document.writeln(" width: 673px;");
    document.writeln(" background-color: #E6F1F9;");
    document.writeln("}");
    document.writeln(".pre_table {");
    document.writeln(" border: 1px solid #ACDFF2;");
    document.writeln(" width: 685px;");
    document.writeln("}");
    document.writeln(".pre_td {");
    document.writeln(" border: 0px solid #ACDFF2;");
    document.writeln(" padding:5px 20px;");
    document.writeln(" margin: 5px 0px;");
    document.writeln(" line-height: 1.5em;");
    document.writeln(" font-family: Verdana, Arial;");
    document.writeln(" color: #666666;");
    document.writeln(" width: 673px;");
    document.writeln(" word-wrap: break-word;");
    document.writeln(" word-break: break-all;");
    document.writeln("");
    document.writeln("}");
    document.writeln(".blank_img {");
    document.writeln(" width: 3px;");
    document.writeln("}");
    document.writeln(".main_editer {");
    document.writeln(" border: 0px none;");
    document.writeln("}");
    document.writeln(".inputbox {");
    document.writeln(" height: 18px;");
    document.writeln(" border: 1px solid #9E9E9E;");
    document.writeln("}");
    document.writeln(".topboard {");
    document.writeln(" border-top: 1px solid #ACDFF2;");
    document.writeln(" border-right: 1px none #ACDFF2;");
    document.writeln(" border-bottom: 1px none #ACDFF2;");
    document.writeln(" border-left: 1px none #ACDFF2;");
    document.writeln("}");
    document.writeln(".9inputbox {");
    document.writeln(" font-size: 9px;");
    document.writeln(" border: 1px solid #9E9E9E;");
    document.writeln(" font-family: Geneva, Arial, Helvetica, sans-serif;");
    document.writeln(" width: 25px;");
    document.writeln("}");
    document.writeln(".rightboard {");
    document.writeln(" border-top-width: 1px;");
    document.writeln(" border-right-width: 1px;");
    document.writeln(" border-bottom-width: 1px;");
    document.writeln(" border-left-width: 1px;");
    document.writeln(" border-right-style: solid;");
    document.writeln(" border-top-color: #ACDFF2;");
    document.writeln(" border-right-color: #ACDFF2;");
    document.writeln(" border-bottom-color: #ACDFF2;");
    document.writeln(" border-left-color: #ACDFF2;");
    document.writeln("}");
    document.writeln("img {");
    document.writeln(" cursor: hand;");
    document.writeln("}");
    document.writeln(".inputbutton {");
    document.writeln(" border: 1px solid #ACDFF2;");
    document.writeln(" background-color: #E6F1F9;");
    document.writeln("}");
    document.writeln("A {");
    document.writeln(" text-decoration: none;");
    document.writeln(" color:#003399;");
    document.writeln("}");
    document.writeln("A:hover {");
    document.writeln(" TEXT-DECORATION: underline;");
    document.writeln("}");
    document.writeln(".moreimage{");
    document.writeln(" border: 1px solid #CCCCCC;");
    document.writeln("}");
    document.writeln(".theBG {");
    document.writeln(" background-color: #E6F1F9; ");
    document.writeln("}");
    document.writeln(".theBOX {");
    document.writeln(" border: 1px solid #ACDFF2;");
    document.writeln("}");
    document.writeln(".theText {");
    document.writeln(" color: #ACDFF2;");
    document.writeln(" font-size: 12px;");
    document.writeln("}");
    document.writeln(".mode_table_quote{");
    document.writeln(" padding:3px 10px;");
    document.writeln(" margin: 5px 10px;");
    document.writeln(" border: 1px dotted #ACDFF2;");
    document.writeln("}");
    document.writeln(".TableTitle {");
    document.writeln(" height:18px;");
    document.writeln(" border:1px solid #ACDFF2;");
    document.writeln(" padding-top:3px;");
    document.writeln(" padding-left:4px;");
    document.writeln(" padding-right:4px;");
    document.writeln(" background-color:#FFFFFF;");
    document.writeln("}");
    document.writeln(".smallHot{");
    document.writeln(" font-size:11px;");
    document.writeln(" font-family:Arial, Helvetica, sans-serif;");
    document.writeln(" color:#FF0000;");
    document.writeln("}")
    document.writeln(".BottomDot{");
    document.writeln(" border-bottom-width: 1px;");
    document.writeln(" border-bottom-style: dotted;");
    document.writeln(" border-bottom-color: #CCCCCC;");
    document.writeln("}")
    document.writeln("-->");
    document.writeln("<\/style>");
    }
    function write_chat(){
    //聊天窗口
    document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"ACDFF2\">");
    document.writeln("  <tr><td><EMBED menu=\'false\' src=\'http:\/\/eq.yepig.cn\/chat\/chat.swf\' type=\'application\/octet-stream\'quality=\'high\' width=\"323\" height=\"245\" \/><\/td><\/tr><\/table>");
    document.writeln("")
    }
      

  3.   


    //全局相关
    var strTit = new Array()
    strTit[00]='<font color=\'#FF0000\'>提示</font>:试一试先将要 <img src=\'bb_bold.gif\' align=\"absmiddle\"> 或者<B>其它效果</B>的文字选中,然后再点击 <img src=\'bb_bold.gif\' align=\"absmiddle\"> 或者<B>其它效果</B>的工具按钮。';
    strTit[01]='<font color=\'#FF0000\'>提示</font>:要在指定位置插入一个表情或者图片?只需要先用鼠标点击要插入的位置,接着插入图片试试。'
    strTit[02]='<font color=\'#FF0000\'>提示</font>:想要做 红-蓝-黑 的彩虹效果?那么就插入两个自定彩虹,一个红色到蓝色,一个蓝色到黑色。'
    strTit[03]='<font color=\'#FF0000\'>提示</font>:打开某个工具栏却不知道怎么关闭?再点一下这个工具按钮,它就会关闭。'
    strTit[04]='<font color=\'#FF0000\'>提示</font>:<img src=\'bb_marquee.gif\' align=\"absmiddle\"> 效果只能用在日志里面哦,在回帖和留言里面是不允许用滚动字效果的。'
    strTit[05]='<font color=\'#FF0000\'>提示</font>:不想花时间弄好看的留言效果吗?到<B>个性代码</B>里找一个你喜欢的效果,稍加改动,又成了你的专属签名了。'
    strTit[06]='<font color=\'#FF0000\'>提示</font>:插入一个 <img src=\'bb_fontlight.gif\' align=\"absmiddle\"> 代码,然后在 <img src=\'bb_fontlight.gif\' align=\"absmiddle\"> 里插入一个图片代码,你就会得到一个带颜色边框的图片了。'
    strTit[07]='<font color=\'#FF0000\'>提示</font>:许多好看的个性留言都是用符号组合成的,你也可以打开 <img src=\'bb_moretext.gif\' align=\"absmiddle\"> ,试试看你能做成什么好看的代码。'
    strTit[08]='<font color=\'#FF0000\'>提示</font>:输入少量文字用 <img src=\'bb_rainbow.gif\' align=\"absmiddle\"> 的<B>自定义彩虹字的效果</B>,会有意想不到的效果哦 - <font color=#800000>■</font><font color=#BF3F3F>■</font><font color=#FF007F>■</font><font color=#FF3FBF>■</font>'
    strTit[09]='<font color=\'#FF0000\'>提示</font>:输入少量文字用 <img src=\'bb_rainbow.gif\' align=\"absmiddle\"> 的<B>自定义彩虹字的效果</B>,会有意想不到的效果哦 - <font color=#333300>■</font><font color=#72003F>■</font><font color=#B23F7F>■</font><font color=#F200BF>■</font>'
    strTit[10]='<font color=\'#FF0000\'>提示</font>:输入少量文字用 <img src=\'bb_rainbow.gif\' align=\"absmiddle\"> 的<B>自定义彩虹字的效果</B>,会有意想不到的效果哦 - <font color=#FFCC99>■</font><font color=#BF8C59>■</font><font color=#7F4C19>■</font><font color=#3F8C00>■</font>'
    strTit[11]='<font color=\'#FF0000\'>提示</font>:在插入 <img src=\'bb_moreimage.gif\' align=\"absmiddle\"> 或者 <img src=\'bb_moreflash.gif\' align=\"absmiddle\"> 时可以切换不同的图片集或者FLASH集,获得更多图片或者FLASH。' //最长
    strTit[12]='<font color=\'#FF0000\'>提示</font>:打算在日志插入浮动FLASH?务必放到最后再加,因为自动预览将每次都会重新显示FLASH,这将占用更多资源。'
    strTit[13]='<font color=\'#FF0000\'>提示</font>:如果日志很长,可考虑将<B>自动预览</B>关闭,需预览时手工点击<B>立即刷新</B>来显示预览。'
    strTit[14]='<font color=\'#FF0000\'>提示</font>:碰到问题可以到网页左侧的<B>交流窗口</B>提问,此时打开网站的所有用户都将看到你的问题,为你排疑解难。'
    strTit[15]='<font color=\'#FF0000\'>提示</font>:各种符号在各种字号下的显示效果都不一样,利用这点你能组合很多好看的效果 - <font style="font-family: Verdana, Arial;"><font size=1 color=#FF2800>●</font><font size=2 color=#FF5000>●</font><font size=3 color=#FF7800>●</font><font size=4 color=#FFA000>●</font></font>'
    strTit[16]='<font color=\'#FF0000\'>提示</font>:有将近一半的浮动FLASH在白色背景下是什么都看不见的,所以你在预览时有必要尝试一下黑色背景。'
    strTit[17]='<font color=\'#FF0000\'>提示</font>:你只需要输入链接然后选中,点击 <img src=\'bb_url.gif\' align=\"absmiddle\"> ,就可以轻松的制作好超级链接。'
    strTit[18]='<font color=\'#FF0000\'>提示</font>:要插入一张图片?很简单,输入图片地址,选中,点击 <img src=\'bb_image.gif\' align=\"absmiddle\"> 即可插入图片。'
    strTit[19]='<font color=\'#FF0000\'>提示</font>:输入一段文字,选中,然后依次点击 <img src=\'bb_bold.gif\' align=\"absmiddle\"> <img src=\'bb_italicize.gif\' align=\"absmiddle\"> <img src=\'bb_underline.gif\' align=\"absmiddle\"> 看看会出现什么事情?'
    strTit[20]='<font color=\'#FF0000\'>提示</font>:写了一篇日志,想让它们全部靠在右边或中间么?全部选择,然后点 <img src=\'bb_right.gif\' align=\"absmiddle\"> 或 <img src=\'bb_center.gif\' align=\"absmiddle\">。'
    //strTit[0]='<font color=\'#FF0000\'>提示</font>:function return_TitleTable(){
    var sTitleTable = '';
    sTitleTable = " "+strTit[parseInt(Math.random()*(-1-(strTit.length)+1)+(strTit.length))]+"<a href='javascript:reloadTitleTable()'>[刷新]</a>";
    return sTitleTable;
    //for(var i=0;i<6;i++){sTitleTable+=strTit+" ";}
    }
    //////////////////////////////////设置显示任务栏的显示
    function isShow(someNAME){
    var imgNAME = document.getElementById('img_'+someNAME);
    var tdNAME  = document.getElementById('td_'+someNAME);
    if(someNAME=='CHAT'){
    imgNAME.src ='img/tool_show.gif';
    imgNAME.title='关闭'
    tdNAME.style.display='';
    tdNAME.innerHTML = '<EMBED menu=\'false\' src=\'chat2\/chat_new.swf\' type=\'application\/octet-stream\' quality=\'high\' width=\"190\" height=\"310\" \/>';
    }
    }//下拉任务栏..聊天窗口
    function ChatBAR(){
    var imgCHAT = document.getElementById('img_CHAT');
    var tdCHAT  = document.getElementById('td_CHAT'); if(imgCHAT.title=='打开'){
    imgCHAT.src ='img/tool_show.gif';
    imgCHAT.title='关闭'
    tdCHAT.style.display='';
    tdCHAT.innerHTML = '<EMBED menu=\'false\' src=\'chat2\/chat_new.swf\' type=\'application\/octet-stream\' quality=\'high\' width=\"190\" height=\"310\" \/>';
    }else{
    imgCHAT.src ='img/tool_hide.gif';
    imgCHAT.title='打开'
    tdCHAT.style.display='none';
    tdCHAT.innerHTML ='';
    }}
    //移动 div 函数
    var move=false; 
    function StartDrag(obj)                       
    {
    // if(event.button==1&&obj.srcElement.tagName.toUpperCase()=="DIV")
     if(event.button==1)
     {
      obj.setCapture();
      obj.style.background="#999";
      move=true;
      } 
    }function Drag(obj)                   
    {
     if(move)
     {
      var oldwin=obj.parentNode;
      oldwin.style.left=event.clientX-50;
      oldwin.style.top=event.clientY-10;
     }
     
     }function StopDrag(obj)
    {
      obj.style.background="#000";
      obj.releaseCapture();
      move=false;
      } 
      
      
    domain = "www.eedit.cn"function callclip(param)
    {
    eval(param).focus();
    eval(param).document.execCommand("selectAll");
    eval(param).document.execCommand("Copy");
    alert('复制成功!');
    }
    function clearALL()
    {
    if(confirm('这个操作很可能让您前功尽弃,是否要清空所有内容?')){
    //删除及建立数组
    delete arrUndo;
    arrUndo = new Array();
    document.getElementById('main_editer').focus();
    document.getElementById('main_editer').document.execCommand("selectAll");
    document.getElementById('main_editer').document.execCommand('Copy');
    document.getElementById('main_editer').value='';
    previw(1);
    document.getElementById('main_editer').focus();
    }
    }var UBBrange;function storeCaret(textEl){
    if(textEl.createTextRange){
    textEl.caretPos = document.selection.createRange().duplicate();
    }
    }function insertAtCaret(textEl, text){
    if (textEl.createTextRange && textEl.caretPos){
    var caretPos = textEl.caretPos;
    caretPos.text += caretPos.text.charAt(caretPos.text.length - 2) == ' ' ? text + ' ' : text;
    } else if(textEl) {
    textEl.value += text;
    } else {
    textEl.value = text;
    }
    }function get_textarea() //获取文本
    {
    var post = main_editer;
    var selected = '';
    if(post.isTextEdit){ 
    post.focus();
    var sel= document.selection;
    var rng= sel.createRange();
    rng.colapse;
    if((sel.type =="Text" || sel.type == "None") && rng !=null){
    if(rng.text.length > 0)        selected = rng.text;
    }
    }        
    return selected;
    }function set_textarea(str) //应用文本
    {
    var r=document.selection.createRange();
    if(r.text==''){
    document.all ? insertAtCaret(main_editer, str) : main_editer.value += str;
    }else{
    r.text=str;
    }
    newUndo(document.getElementById("main_editer").value);
    previw(0);
    }
    function show_win(win_name,flag){
    if(flag==0){
    if(document.all[win_name].style.display==''){
    document.all[win_name].style.display='none';
    }else{
    document.all[win_name].style.display='';
    }
    }else if(flag==1){
    document.all[win_name].style.display='';
    }else if(flag==2){
    document.all[win_name].style.display='none';
    }
    }
    function set_font() //设置字体
    {
    var s = get_textarea();
    if(selFont.selectedIndex!=0){
    s = '[ftf=' + selFont.options[selFont.selectedIndex].value + ']'+ s + '[/ft]';
    }
    selFont.selectedIndex=0;
    set_textarea(s);
    }
    function set_fontsize() //设置字体大小
    {
    var s = get_textarea();
    if(selFontSize.selectedIndex!=0){
    s = '[fts=' + selFontSize.options[selFontSize.selectedIndex].value + ']'+ s + '[/ft]';
    }
    selFontSize.selectedIndex=0;
    set_textarea(s);
    }
    function be_bold() //加粗
    {
    var s = get_textarea();
    s = ''+ s + '';
    set_textarea(s);
    }
    function be_italicize() //加斜体
    {
    var s = get_textarea();
    s = '[I]'+ s + '
    ';
    set_textarea(s);
    }
    function be_underline() //加下划线
    {
    var s = get_textarea();
    s = ''+ s + '';
    set_textarea(s);
    }
    function set_color(s_col,s_col2,flag,s) //设置颜色
    {
    if(s=='') s = get_textarea();
    if(flag){
    s = '[ffg,'+s_col+','+s_col2+']'+s+'[/ft]'
    }else{
    s = '[ftc='+ s_col + ']' + s + '[/ft]';
    }
    set_textarea(s);
    }
    function be_url() //设置超级链接
    {
    var s = get_textarea();
    s = ''+ s + '';
    set_textarea(s);
    }
    function be_email() //设置超级链接
    {
    var s = get_textarea();
    s = ''+ s + '';
    set_textarea(s);
    }
    function set_face(s_face) //设置表情
    {
    var s = get_textarea();
    s = s + '[em]' + s_face + '[/em]';
    set_textarea(s);
    }
    function be_image(s) //设置图片
    {
    if(s=='') s = get_textarea();
    s = '';
    set_textarea(s);
    }
      

  4.   


    function be_center() //置中
    {
    var s = get_textarea();
    s = '[M]'+ s + '[/M]';
    set_textarea(s);
    }
    function be_right() //置右
    {
    var s = get_textarea();
    s = '[R]'+ s + '[/R]';
    set_textarea(s);
    }
    function set_flash() //设置flash
    {
    var s = get_textarea();
    var wfh,wfw,wfl,wft;
    if(win_flash_bg.checked){
    if(win_flash_autosize.checked){
    wfw=350;
    wfh=300;
    }else{
    wfw=win_flash_width.value;
    wfh=win_flash_height.value;
    }
    wfl=win_flash_left.value;
    wft=win_flash_top.value;
    s='[flasht,' + wfw + ',' + wfh + ',' + wfl + ',' + wft + ']' + win_flash_url.value + '[/flasht]'
    }else{
    if(win_flash_autosize.checked){
    s='[flash]' + win_flash_url.value + '[/flash]'
    }else{
    wfw=win_flash_width.value;
    wfh=win_flash_height.value;
    s='[flash,' + wfw + ',' + wfh + ']' + win_flash_url.value + '[/flash]'
    }
    }
    set_textarea(s);
    show_win("win_flash",2);
    }
    function set_video() //设置video
    {
    var s = get_textarea();
    var wvh,wvw,wvap,wvar
    if(win_video_autoplay.checked){wvap='true';}else{wvap='false';}
    if(win_video_autoreplay.checked){wvar='true';}else{wvar='false';}
    if(win_video_autosize.checked){
    s='[video,'+ wvar +','+ wvap +']' + win_video_url.value + '[/video]'
    }else{
    wvw=win_video_width.value;
    wvh=win_video_height.value;
    s='[video,'+ wvw +','+ wvh +','+ wvar +','+ wvap +']' + win_video_url.value + '[/video]'
    }
    set_textarea(s);
    show_win("win_video",2);
    }
    function set_audio() //设置audio
    {
    var s = get_textarea();
    var waar,waap,wah
    if(win_audio_autoplay.checked){waap='true';}else{waap='false';}
    if(win_audio_autoreplay.checked){waar='true';}else{waar='false';}
    if(win_audio_hide.checked){wah='true';}else{wah='false';}
    s='[audio,'+ waar +','+ waap +','+ wah +']' + win_audio_url.value + '[/audio]'
    set_textarea(s);
    show_win("win_audio",2);
    }
    function set_rainbow(){ //设置彩虹文字

    var wr_text = win_rainbow_text.value;
    var wr_code,wr_rgb,r,g,b,i,j,istep
    var wr_rgb1,wr_rgb2,r1,g1,b1,r2,g2,b2

    r1=g1=b1=r2=g2=b2=0;
    r=0;g=0;b=0;istep=0;
    wr_code='';

    if(wr_text==''){
    show_win('win_rainbow',0);
    return;
    }

    if(win_rainbow_style1.checked){
    istep=40;
    r=255;i=1;j=0;
    do{
    if(wr_text.charCodeAt(j) != 32){
    if(g+istep<256){
    if(i==1)g+=istep;
    }else if(i==1){
    i=2;g=255;
    }
    if(r-istep>-1){
    if(i==2)r-=istep;
    }else if(i==2){
    i=3;r=0;
    }
    if(b+istep<256){
    if(i==3)b+=istep;
    }else if(i==3){
    i=4;b=255;
    }
    if(g-istep>-1){
    if(i==4)g-=istep;
    }else if(i==4){
    i=5;g=0;
    }
    if(r+istep<256){
    if(i==5)r+=istep;
    }else if(i==5){
    i=6;r=255;
    }
    if(b-istep>-1){
    if(i==6)b-=istep;
    }else if(i==6){
    i=1;b=0;
    }
    wr_rgb='';
    wr_rgb+=parseInt(r).toString(16).length==1 ? 0+parseInt(r).toString(16) : parseInt(r).toString(16);
    wr_rgb+=parseInt(g).toString(16).length==1 ? 0+parseInt(g).toString(16) : parseInt(g).toString(16);
    wr_rgb+=parseInt(b).toString(16).length==1 ? 0+parseInt(b).toString(16) : parseInt(b).toString(16);
    wr_rgb=wr_rgb.toUpperCase();
    wr_code+='[ftc='+ wr_rgb +']'+wr_text.charAt(j)+'[/ft]';
    }else{
    wr_code+=wr_text.charAt(j);
    }
    j++;
    }while (j<wr_text.length);
    }else if(win_rainbow_style2.checked){
    istep=255/wr_text.length;
    for(i=1;i<wr_text.length+1;i++){
    if(wr_text.charCodeAt(i-1)!=32){
    r+=istep;
    g+=istep;
    b+=istep;
    if(r>255) r=255;
    if(g>255) g=255;
    if(b>255) b=255;
    wr_rgb='';
    wr_rgb+=parseInt(r).toString(16).length==1 ? 0+parseInt(r).toString(16) : parseInt(r).toString(16);
    wr_rgb+=parseInt(g).toString(16).length==1 ? 0+parseInt(g).toString(16) : parseInt(g).toString(16);
    wr_rgb+=parseInt(b).toString(16).length==1 ? 0+parseInt(b).toString(16) : parseInt(b).toString(16);
    wr_rgb=wr_rgb.toUpperCase();
    wr_code+='[ftc='+ wr_rgb +']'+wr_text.charAt(i-1)+'[/ft]';
    }else{
    wr_code+=wr_text.charAt(i-1);
    }
    }
    }else if(win_rainbow_style3.checked){
    istep=255/wr_text.length;
    for(i=1;i<wr_text.length+1;i++){
    if(wr_text.charCodeAt(i-1)!=32){
    r+=istep;
    g=29;
    b=36;
    if(r>255) r=255;
    if(g>255) g=255;
    if(b>255) b=255;
    wr_rgb='';
    wr_rgb+=parseInt(r).toString(16).length==1 ? 0+parseInt(r).toString(16) : parseInt(r).toString(16);
    wr_rgb+=parseInt(g).toString(16).length==1 ? 0+parseInt(g).toString(16) : parseInt(g).toString(16);
    wr_rgb+=parseInt(b).toString(16).length==1 ? 0+parseInt(b).toString(16) : parseInt(b).toString(16);
    wr_rgb=wr_rgb.toUpperCase();
    wr_code+='[ftc='+ wr_rgb +']'+wr_text.charAt(i-1)+'[/ft]';
    }else{
    wr_code+=wr_text.charAt(i-1);
    }
    }
    }else if(win_rainbow_style4.checked){
    istep=255/wr_text.length;
    for(i=1;i<wr_text.length+1;i++){
    if(wr_text.charCodeAt(i-1)!=32){
    r=0;
    g=174;
    b+=istep;
    if(r>255) r=255;
    if(g>255) g=255;
    if(b>255) b=255;
    wr_rgb='';
    wr_rgb+=parseInt(r).toString(16).length==1 ? 0+parseInt(r).toString(16) : parseInt(r).toString(16);
    wr_rgb+=parseInt(g).toString(16).length==1 ? 0+parseInt(g).toString(16) : parseInt(g).toString(16);
    wr_rgb+=parseInt(255-b).toString(16).length==1 ? 0+parseInt(255-b).toString(16) : parseInt(255-b).toString(16);
    wr_rgb=wr_rgb.toUpperCase();
    wr_code+='[ftc='+ wr_rgb +']'+wr_text.charAt(i-1)+'[/ft]';
    }else{
    wr_code+=wr_text.charAt(i-1);
    }
    }
    }else if(win_rainbow_style5.checked){
    if(win_rainbow_A.value.length!=6||win_rainbow_B.value.length!=6){
    alert('颜色代码错误!');
    return;
    }else{
    wr_rgb1=win_rainbow_A.value;
    wr_rgb2=win_rainbow_B.value;
    r1=parseInt("0x"+String(wr_rgb1).substr(0,2));
    g1=parseInt("0x"+String(wr_rgb1).substr(2,2));
    b1=parseInt("0x"+String(wr_rgb1).substr(4,2));
    r2=parseInt("0x"+String(wr_rgb2).substr(0,2));
    g2=parseInt("0x"+String(wr_rgb2).substr(2,2));
    b2=parseInt("0x"+String(wr_rgb2).substr(4,2));;
    if(isNaN(r1)) r1=0
    if(isNaN(g1)) g1=0
    if(isNaN(b1)) b1=0
    if(isNaN(r2)) r2=0
    if(isNaN(g2)) g2=0
    if(isNaN(b2)) b2=0
    istep=255/wr_text.length;
    for(i=1;i<wr_text.length+1;i++){
    if(wr_text.charCodeAt(i-1)!=32){
    wr_rgb='';
    wr_rgb+=parseInt(r1).toString(16).length==1 ? 0+parseInt(r1).toString(16) : parseInt(r1).toString(16);
    wr_rgb+=parseInt(g1).toString(16).length==1 ? 0+parseInt(g1).toString(16) : parseInt(g1).toString(16);
    wr_rgb+=parseInt(b1).toString(16).length==1 ? 0+parseInt(b1).toString(16) : parseInt(b1).toString(16);
    wr_rgb=wr_rgb.toUpperCase();
    wr_code+='[ftc='+ wr_rgb +']'+wr_text.charAt(i-1)+'[/ft]';
    r1>r2?r1-=istep:r1+=istep;
    g1>g2?g1-=istep:g1+=istep;
    b1>b2?b1-=istep:b1+=istep;
    if(r1>255) r1=255;
    if(r1<0) r1=0;
    if(g1>255) g1=255;
    if(g1<0) g1=0;
    if(b1>255) b1=255;
    if(b1<0) b1=0;
    }else{
    wr_code+=wr_text.charAt(i-1);
    }
    }
    }
    }
    set_textarea(wr_code);
    show_win("win_rainbow",0);
    }function be_marquee() //滚动文字
    {
    var s = get_textarea();
    s = '[marque]'+ s + '[/marque]';
    set_textarea(s);
    }
      

  5.   

    <div><input type='button' value='提交' /></div>