As I've mentioned before [a] I like jQuery and [b] we'll be shipping jQuery with Visual Studio in the future. I felt I really ought to visit my blog scripts and migrate them to jQuery. My blog scripts aren't very complicated. They perform 4 actions:
Up 'til now I've used prototype.js to do this because the Lightbox JS script from Lokesh Dhakar has a dependency on prototype.js. To keep the number of scripts to a minimum I just did all my other housekeeping using prototype.js. To switch to jQuery I needed a new "lightbox" script and I plumped for the jQuery lightBox plugin from Leandro Vieira Pinho. Switching from prototype to jQuery was a doddle:
Generally speaker, jQuery allows you to express things a little more succinctly but the two dialects are remarkably similar. I'm not hosting the lightbox (icon) images on my blog domain so I had to set the image paths at initialisation:
}); // Select all links that contains lightbox in the attribute rel
Using this selector mimics the behaviour of the original Lightbox JS script but of course you have all the flexibility provided by jQuery selectors to enable lightBox functionality of different elements.
I'm still using the same Twitter.js script from Remy Sharp that I was using before and it continues to do sterling service.
The most difficult part was resisting the temptation to add lots of crazy jQuery effects...
PingBack from http://www.tmao.info/just-switched-my-blog-scripts-to-jquery/