后台default.aspx.cs:  
public string Url = "<br/>202.54.10.123<br/>200.54.10.124<br/>202.54.10.125<br/>"前台如何写  实现页面显示202.54.10.123
200.54.10.124
202.54.10.125点击一个就跳转一个地址这种效果

解决方案 »

  1.   


    <!DOCTYPE HTML>
    <html>
        <head>
            <meta charset="gb2312" />
            <title></title>
        </head>
        <body>
            <textarea id="test">
                202.54.10.123
                200.54.10.124
                202.54.10.125
            </textarea>
            <br />
            <script>
                function $(el){
                    return typeof el == 'string' ? document.getElementById(el) : el;
                }
                var str = $('test').value;
                var re = /.+\n/g;
                alert(str.match(re))
                str.replace(re, function($){
                    document.write( '<a href="http://'+$+'" target="_blank">'+$+'</a><br />' );
                })
            </script>
        </body>
    </html>试试