a bit of a long title to this thread, I know, just trying to make it obvious. lol

Anyhow, I am building a Twitter widget for my own website and have got really stuck on one aspect of it, namely the 'source' i.e. which application the 'user' used to post their Tweet.

My home_timeline is being formatted in json and in the example image below you can see that the output produces the relevent entity; 'source':-


While this is great, it actually outputs it as a fully formed link, i.e. if you click on 'Twitter for iPhone' in the output, it will take you to the specific page.

This is great if that is all you want to do but I don't.

Below is a snippet from my php code that shows how it is displayed on my webpage:-

<span class="device">via <span class="device_link"><?=$status->source?></span></span>

and from this it actually appears on the webpage View Source as:-

<span class="device">via <span class="device_link"><a href="http://twitter.com/#!/download/iphone" rel="nofollow">Twitter for iPhone</a></span></span>

As you can see, I have no control over the 'anchor' apart from styling with CSS.

What I really want to do is to be able to control the link's target, i.e. I want to open the link in "_blank"

Failing that, I would rather have just the text 'Twitter for iPhone' shown without linking it, I could live with that.

I have looked around the web and seen various java examples to open all links to a specified target but this relies on the users browser having js enabled, not a route I wish to take.

Any help would be appreciated.

Kind regards..,


Use this, but it will be for all links in your page, so:

<base target="_blank">
commented: WOW, so simple. thx +3

Use this, but it will be for all links in your page, so:

<base target="_blank">

Superb and so simple, thank you.