Monday, August 29, 2011

How to have great wait cursor animations for free

While searching for a "trivial" wait animation for one of my AJAX projects I've found a great online solution for the problem. It has been around for years now, but it's new for me and I decided to share it.

Introducing a free AJAX load animation generator. It's great to have it around.

Here are some images I've created briefly as a showcase ..... well I guess they already have your attention :)

Thursday, August 25, 2011

Linking to Android Market applications on the web

While working on web version of Da Dictionary I've decided to add link to Android version. Web links to Android Market looks like this where '' is the package name which is unique for Android Market. This seams to work well when opened from PC browser. However opening this link from Android is a different story. The best way to open it is directly in Android Market application which works with different URI scheme. It looks like market://details? where again we see the same package name mentioned. While built-in Android browser plays it smart and open the link in directly in Market Application alternative browsers like Firefox does not do so and viewing web version of Android Market on an Android phone is far form what users expected to see.

My solution

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function() {
  // some more core here ... 
  function updateAndroidMarketLinks()
    var ua = navigator.userAgent.toLowerCase();
    if (0 <= ua.indexOf("android")) {
      // we have android
      $("a[href^='']").each(function() {
        this.href = this.href.replace(/^http:\/\/market\.android\.com\//,

<a href="" target="_blank">Download for Android</a>

As you can see my solution is based on JavaScript and jQuery. The idea is to search for 'android' sub-string inside browser's UserAgent and if that is the case - replace HTTP URI part with Android Market URI part, inside all links.

I believe a JavaScript only version is not hard to do, but I prefer to use jQuery.