Posted By

Schart on 01/02/12


Tagged

url jquery user tweetify


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Balamir
BrockSamsom


Modified Tweetify for WebCloud


 / Published in: jQuery
 

URL: http://www.wc.wchosting.tk

Made for WebCloud.

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  5.  
  6. <script>
  7. $(function() {
  8. $.fn.tweetify = function() {
  9. this.each(function() {
  10. $(this).html(
  11. $(this).html() .replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>')
  12. .replace(/(^|\s)@(\w+)/g,'$1<a href="http://wc.wchosting.tk/$2">@$2</a>')
  13. );
  14. });
  15. return $(this);
  16. }
  17. $("#div").tweetify();
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <div id="div">
  23. @schart - Link
  24. </div>
  25. @schart - Not link
  26. </body>
  27. </html>

Report this snippet  

You need to login to post a comment.