This post contains useful jquery plugins and javascript tip how to replace text URL to HTML links. I had tried these plug-ins at labs.9lessons. I hope it's very useful for your social media web projects. Thanks!
Javascript Text to Link
<script type="text/javascript">
function text_to_link(text)
{
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
}
var linkdata=text_to_link("9lessons programming blog http://www.9lessons.info");
document.write(linkdata);
</script>
function text_to_link(text)
{
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(exp,"<a href='$1' target='_blank'>$1</a>");
}
var linkdata=text_to_link("9lessons programming blog http://www.9lessons.info");
document.write(linkdata);
</script>
Useful Jquery Plugins
this is a cool tip on plugins
ReplyDeleteyou can even make it a userscript for all websites
ReplyDeletethat's all cool & great js , thank you very much for sharing.
ReplyDeleteDon't get your point
ReplyDeletethis is a great javascript
ReplyDeletethank you!
ReplyDelete