/ Published in: jQuery
Made for WebCloud.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script> $(function() { $.fn.tweetify = function() { this.each(function() { $(this).html( $(this).html() .replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1">$1</a>') .replace(/(^|\s)@(\w+)/g,'$1<a href="http://wc.wchosting.tk/$2">@$2</a>') ); }); return $(this); } $("#div").tweetify(); }); </script> </head> <body> <div id="div"> @schart - Link </div> @schart - Not link </body> </html>
URL: http://www.wc.wchosting.tk