首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

该功能怎么实现

2012-06-15 
求助该功能如何实现?后台default.aspx.cs:public string Url br/202.54.10.123br/200.54.10.124br

求助 该功能如何实现?
后台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

点击一个就跳转一个地址这种效果

[解决办法]

HTML code
<!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> 

热点排行