首先你的留言区域要是frame或者iframe才可以,textarea是不可以的~~

解决方案 »

  1.   

    可以用这个进行判断
    str.slice(0,7)=="http://"
      

  2.   

    你这个是以这个开头而已,还有结尾到哪里结束?
    而且,应该是一大段的文本提交以后,自动把其中http;//的连接部分转换成超连接模式。
      

  3.   

    var str="sadfasfasdfhttp://www.xxx.com.cnsdfsdafasdf",reg=/http:\/\/www\..*\.(com|net|cn)/
    if(reg.test(str))document.write("<a href='"+str.match(reg)[0]+"'>"+str.match(reg)[0]+"</a>")
      

  4.   

    <iframe name="demo"></iframe>
    <script>
    demo.document.designMode="on"
    </script>
      

  5.   

    就是把在线编辑启动,需要IE5.5以上.你可以查MSDN中的innerHTML属性,基本的表单元素都支持.
      

  6.   

    <div align=left id=App style="background-color:#F7F7F7;height:380px;overflow:auto;width:100%;z-index:2" contentEditable></div>
    <textarea ID=Info></textarea>
    <input type=button ID=Save onclick="Info.value=App.innerHTML;">
    这样在App中让用户写,保存时Save,显示时用Info就带链接了