如何使用javascript更改#标签+字符链接
How to change # tag + Character to link using javascript
This is going #right on the way
与
This is going <a href="http://twitter.com/#!/search/right">right</a> on the way
即使这样也是可以接受的
even this is also acceptable
This is going <a href="http://twitter.com/#!/search/right">#right</a> on the way
不同类别和id中的#(哈希)标签的页面
The page lots's of # (hash) tag in different classes and id's
var string = "This is going #right on the way";
string.replace(/#(S*)/g,'<a href="http://twitter.com/#!/search/$1">$1</a>')
演示: http://jsfiddle.net/dKm82/
这篇关于更改#hash 标记以链接页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!