0

My issue is that I have a group of tweets being called in with jQuery, but its calling them in all as plain text. My goal would be to have any thing with an http:// automatically linked. In this case, something like this:

<a href="{link}"> {link} </a>

With {link} being replaced with the actual link inserted. For example, if I have a tweet that says, "Visit this cool link! http://foo.com/" I'd want the link to actually work, as right now its just plain text, and therefore not clickable.

Thanks in advance! :)

EDIT: Here's a link to what I have so far. http://jsfiddle.net/Remixz/uCk4s/

Remixz
  • 143
  • 1
  • 5
  • Possible duplicate of http://stackoverflow.com/questions/37684/replace-url-with-html-links-javascript – Ender Mar 30 '11 at 16:34

1 Answers1

3

Have a look at this accepted answer to this question: How to replace plain URLs with links?

I think that does exactly what you are looking for.

I've forked the plug-in you were using on github and made an update to it to include the linkify function. Here's a demo of the updated version in action: http://jsfiddle.net/Ender/CrzCZ/

And here's the updated plug-in on github: https://github.com/ender2021/jQuery-Tweets/raw/master/js/jquery.tweets.0.1.js

Community
  • 1
  • 1
Ender
  • 14,995
  • 8
  • 36
  • 51
  • @Remixz - I've updated my answer with a demo and link to the updated plug-in on github. – Ender Mar 30 '11 at 17:31