JavaScript Libraries
I've been working a lot with JavaScript lately so I decided to check out all the JavaScript libraries that are available. Many of these libraries have useful utility methods and modules for JSON and AJAX. There are six libraries that I intend to explore; the Microsoft AJAX Client Library (I need to see what was added in 3.5), the Prototype JavaScript Framework, the Dojo Toolkit, MochiKit, and the Yahoo! User Interface Library (YUI), and jQuery.
What prompted my interest in JavaScript libraries were some simple client scripting problems that proved to be unexpectedly time consuming. For example, I needed to format a ISO 8601 date string "2008-01-11T02:34:42.177Z" into a more readable date format. There are many different date formats being used by RSS feeds, web application APIs, web services, etc. I was hoping to find a library with conversion methods for all the standard date formats but none of these 6 libraries could convert that particular date string into a JavaScript Date object.
Another frequent bit of JavaScript that I need to write may be simplied by using jQuery. A compiled help file has problems getting a reference to background image files that are specified in CSS. To work around that problem I need to write some JavaScript to find the element based on the class name or id and set its style.background property. jQuery has a method to get all the elements with a particular class name and set a property for them all with just one statement and no loops.
Most of the JavaScript I'm writing is for my project documentation using compiled help files or help collections. It is possible to use these JavaScript libraries within help files. You just add the javascript file as a project item and it gets compiled in with all the web pages, images, and style sheets. So far I have only baked in jQuery, Prototype, and the Microsoft AJAX Client Library because there was just one file to include. I can even use two libraries within one page as long as the namespaces do not clash. Most of the disadvantages to using so many JavaScript libraries do not apply to help files. There are no browser compatibility issues because a help file always uses Internet Explorer. There are no server side considerations. The JavaScript libraries do not need to be downloaded.
I'm starting to use Microsoft Visual Web Developer 2008 Express Edition to code my JavaScript experiments. I was using Ultra-Edit or Microsoft Expression Web but Visual Web Developer 2008 gives me some Intellisense for the JavaScript libraries. Since I am only concerned with Internet Explorer compatibility I use the Web Developer Helper for script debugging rather than Firebug, unless I need additional clues to solve an error.