Modified Tweetify for WebCloud


/ Published in: jQuery
Save to your folder(s)

Made for WebCloud.


Copy this code and paste it in your HTML
  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>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.