本帖最后由 jayhai 于 2011-08-30 22:32:15 编辑

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      </head>
      <body>
    <div id="apDiv1"> s | s | s | s |<br /> s | s</div>
    <form id="form1" name="form1" method="post" action="">
      <p>
        <label>
          <textarea name="txtgo" id="txtgo" cols="80" rows="10" ondblclick="Xiao();"></textarea>
        </label>
      </p>
      <p>
        <label>
          <input type="button" name="b1" id="b1" onclick="kan();" value="观看" />
        </label>
        <label>
          <input type="reset" name="b2" id="b2" value="清除" />
        </label>
        <label>
          <input type="button" name="b2" id="b2" onclick="pastetxt();" value="粘贴" />
        </label>
      </p>
    </form>
    </body><script type="text/javascript">function Xiao()
    {
        document.getElementById("txtgo").ondblclick=function(){
            this.select();
            }
    }function pastetxt() 

    var ta = document.getElementById("txtgo");//获取控件 
    ta.focus();//设置其焦点 
    ta.document.execCommand("paste"); // 粘贴 
    } function kan(){
        var de=document.getElementById("apDiv1");
        var oP,oTextNode,deDao,oB;
        deDao=document.getElementById("txtgo").value;
        oP=document.createElement("p");
        oP.setAttribute("txt",deDao);
        oP.innerHTML = deDao.replace(/\n/g, "<br />");
        de.appendChild(oP);
        de.style.visibility="visible";
        document.getElementById("b1").disabled=true;
        }
    </script></html>
      

  2.   

    用innerHTML别用document.createTextNode添加文本内容``
      

  3.   

    innerHTML只是和html页面结合 我想加到单独的层里面啊 在自己的层里面显示
      

  4.   


    那就你指定的那个div层.innerHTML显示这些内容就行了~·
      

  5.   

    哦 我多此一举 没认真看你的代码  谢谢  就上一个帖子 不知道你有没有方法可以告诉我的 毕竟那个问题还是没解决的http://topic.csdn.net/u/20110816/23/398f6c53-cd2b-41c3-bd37-c72bdd75178f.html
      

  6.   

    给点思路都可以啊 我真的很想解决那个东西
    http://topic.csdn.net/u/20110816/23/398f6c53-cd2b-41c3-bd37-c72bdd75178f.html
      

  7.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript" defer="defer">var s,arr = ['http://yzz.web.officelive.com/1.jpg',
     'http://yzz.web.officelive.com/2.jpg',
     'http://yzz.web.officelive.com/3.jpg',
     'http://yzz.web.officelive.com/4.jpg',
     'http://yzz.web.officelive.com/5.jpg'],count = 0;setInterval(function(){
    if(arr[count]){
    document.getElementById('imggg').src = arr[count];
    count++;
    if(count == 5){
    count = 0;
    }
    }
    },2000);function i1(s){
        this.s=s;
        document.getElementById("imggg").src="http://yzz.web.officelive.com/1.jpg";
    count = 0;
        }
        
    function i2(s){
        this.s=s;
        document.getElementById("imggg").src="http://yzz.web.officelive.com/2.jpg";
    count = 1;
        }    function i3(s){
        this.s=s;
        document.getElementById("imggg").src="http://yzz.web.officelive.com/3.jpg";
    count = 2;
        }function i4(s){
        this.s=s;
        document.getElementById("imggg").src="http://yzz.web.officelive.com/4.jpg";
    count = 3;
        }
        
    function i5(s){
        this.s=s;
        document.getElementById("imggg").src="http://yzz.web.officelive.com/5.jpg";
    count = 4;
        }    function ddd(){
        if(s==undefined) s="http://www.baidu.com/";
        window.open(s);
        }
    </script>
    </head><body>
    <table width="212" border="0" cellspacing="0">
      <tr>
        <td><img id="imggg" src="http://yzz.web.officelive.com/1.jpg" width="220" onclick="ddd();" height="141" /></td>
      </tr>
      <tr>
        <td><a id="img1" href="#"  onclick="i1('http://www.baidu.com/');">1</a> <a id="img2" href="#" onclick="i2('http://www.163.com/');">2</a> <a href="#" onclick="i3('http://www.ali213.net')">3</a> <a href="#" onclick="i4('http://www.library.hn.cn/')">4</a> <a href="#" onclick="i5('http://www.gougou.com')">5</a></td>
      </tr>
    </table></body>
    </html>