Thursday, March 19, 2009

A better world with jQuery

I know I’m far behind the rest of the world, but that’s because I usually code on the web server and not on the web client. But yesterday I experienced the beauty of  jQuery first hand :)

I was first exposed to jQuery unknowingly some months ago when I lent some “free” consulting time to a web project. Since I happen to have done my share of java scripting over the years I got the task of breaking up the static design to dynamic pages, meaning constructing the script calls depending on the data. I didn’t really have a deep understanding of the $(‘#id’) syntax but I grasped the idea and made it work.

Since then I’ve read some articles about jQuery and yesterday I got another task on the web project. The task was to check if a flash had loaded, and if not, show some html instead. With a bit more knowledge of what I was looking at and figuring out that the flash was loaded with a jQuery plugin it was a breeze to implement.

$(document).ready(function() {
        if( sIFR.isActive == false )
        {
            $('#non_flash_content').show();
        }
    });

Days like this makes it worth while living, and the fact that jQuery will be natively supported in Visual Studio is great news!