Posts Tagged ‘ JavaScript

Twittering from mobile website

LogYourRun allows users to share their activities using both Twitter and Facebook.  On the website site this is easily taken care of by Facebook Connect as well as a direct link to Twitter.  However, on the iPhone, most people will not be using the twitter website as their main twitter client – usually they will have one of the numerous twitter iPhone applications installed.  Since a bunch of these actually respond to custom URL schemes the tweet can be sent directly to the Twitter app using some clever JavaScript as posted by Mark J.

Before adding the JavaScript code and the link to the page I check in PHP if the user is using an iPhone.  If they are, a link will appear that will attempt to launch one of 5 different twitter apps.  Using this approach will quit the LogYourRun application or the mobile safari session and open the application.  Before doing so – mobile Safari will pop up a warning saying that it does not respond to the URL (because I do not have Tweetie on my iPod Touch and this is the first app that is being launched).

  • Share/Bookmark