比如 我输入www.abc.com能在叶面显示的时候能够自动变成超级链接,要求服务器端实现。能有现成代码最好。。谢谢先

解决方案 »

  1.   

    请问你输入的网址是在地址栏还是还是表单中中,下面是一段在表单中输入转换成 超链接的代码:
    <%@ page contentType="text/html; charset=GBK"%><html>
    <head>
    <title>URL转换超链接</title>
    <link href="/defaultroot/skin/blue/style.css" rel="stylesheet" type="text/css" /></head>
    <body  onload="resizeWin(650,300);" class="MainFrameBox Pupwin"><table width="100%" border="0" cellpadding="10" cellspacing="0" class="docBoxNoPanel">
    <form name="form1" action="#" method="POST">
    <tr>
          <td colspan="2">
        超级链接:<%if(request.getParameter("url")!=null){out.print("<a href='http://"+request.getParameter("url")+"'>"+request.getParameter("url")+"</a>");}%>
      </td>
        </tr>
    <tr>
    <td width="70" nowrap="nowrap">URL:</td>
    <td >
    <input name="url" type="text" class="inputText" style="width:100%"/>
    </td>

    </tr>
    <tr>
          <td colspan="2">
        <button class="btnButton4font" onclick="javascript:form1.submit();">保存退出</button>
      </td>
        </tr>
    </form>
    </table>
    </body>
    </html>
      

  2.   

    不明白你想干什么,不就是拼url嘛
      

  3.   

    我的意思是一段文本   包含各种 ,就把其中的 url转换为超级链接aaaawww.sina.com.cncdef 转换成  aaaa<a href="http://sina.com.cn">www.sina.com.cn</a>cdef