我已经在这种情况下乱跑了,我已经尝试了我在stackoverflow中找到的所有答案,并尝试使用linkify但是没有成功,无法使其工作,我宁愿不必使用任何Javascript库,jquery,mootools等......
所以这就是我想要实现的目标;
我的每个帖子都有一个评论部分,我希望每次用户在评论中发布网址时:
<div id="container">
Nice, here is the respective link that you were asking for: www.linkforanywebsite.com
</div>
Run Code Online (Sandbox Code Playgroud)
变成这样:
<div id="container">
Nice, here is the respective link that you were asking for: <a href="www.linkforanywebsite.com">www.linkforanywebsite.com</a>
</div>
Run Code Online (Sandbox Code Playgroud)
任何指南/ jsfiddle工作示例都非常感谢
感谢您的时间和帮助!
| 归档时间: |
|
| 查看次数: |
32621 次 |
| 最近记录: |