Great Resources: Learning JS, AJAX, and DOM

Over the weekend, I decided it was finally time to learn how to use JS and AJAX. I’d deliberately avoided using JS for anything I could accomplish in PHP - but I admit that I was getting a bit intrigued by the AJAX hooplah.

I found some very useful resources for dealing with JS, AJAX, and DOM, so I thought I’d share them for any other eager learners.

Getting Started with AJAX

The first place I stopped in my quest for knowledge was the Mastering Ajax series of articles at IBM’s Developer Works.

I read through the first half of the series. Articles 1, 2, and 3 give a pretty good overview of how to create and use an AJAX request. The later articles introduce the DOM and provide a good overview of how to work with the AJAX response and edit the existing web page.

After reading the first two articles, I was able to re-craft the examples and create some basic AJAX-driven forms of my own. It wasn’t anything exciting - but the concept was easy enough to master.

Although you can get by without ever working directly with the AJAX request object, I agree with the author of this series of articles. It’s best to learn to do something the hard way first - then you can take shortcuts.

AJAX the Easy Way - Prototype.js

Later in the weekend, I set about creating my first real AJAX application. My Digg Wordpress Plugin uses AJAX to check the Digg API for info on an article after the page has loaded.

I tried to rework the code that I’d built with the Developer Works tutorial, but I ran into a problem when I had to make more than one request. I knew I had to make extra instances of the HttpRequest object, but I was having trouble getting the code to execute the way I wanted it to. Admittedly I’m a JS newbie - the first Javascript I ever wrote was the code from the first AJAX tutorial.

I found a great solution though - prototype.js. This is a javascript/ajax framework that makes it much simpler to work with the base AJAX class.

This made it much easier to create multiple instances of an AJAX request class and have them simultaneously fire off and handle requests. It also handles some of the browser compatibility issues. I like to do things on my own, but I’m pretty sure I’ll be using prototype.js from now on for any AJAX projects I work on.

DOM: Document Object Model Resources

Once I got a hang of sending and processing requests with AJAX, I had to turn to DOM to edit the page. After reading through the Developer Works tutorial and fiddling a bit on my own, I found this surprisingly easy.

If you’ve got an understanding of OOP and XML, the DOM should be pretty straightforward for you. However, there are a decent amount of methods/properties you’ll run into. I found two great references that I’ll be using for a while until I get more familiar with the DOM methods/properties.

howtocreate.co.uk has a compact list of pertinent methods and properties. It’s not explained very well, but it’s good for looking up a method quickly. By contrast, Javascript Kit has a thorough reference of methods and properties with explanations. It’s a bit more verbose, but a better choice if you haven’t got a clue how a method works.

Working with JS, AJAX, and DOM is pretty simple - especially if you already know a scripting language like PHP. So don’t wait any longer - go out and add to your repertoire.


Bookmark and Share:
These icons link to social bookmarking sites where readers can share and discover new web pages.

  • Digg
  • Furl
  • del.icio.us
  • StumbleUpon
  • MisterWong
  • DZone
  • Technorati

Tags: , , , ,

Leave a Reply

buy cheap viagra buy cheap viagra online buy discount viagra online buy viagra from india buy online viagra buy viagra india buy viagra online cheap viagra cheap viagra online discount viagra discount viagra online viagra india rx get viagra online non prescription viagra order viagra order viagra india order viagra online viagra for sale viagra no prescription viagra on line buy viagra online no prescription best price for viagra buy cheapest viagra buy generic viagra buy generic viagra from india online buy sildenafil citrate buy sildenafil citrate online buy viagra cheap buy viagra cheap prices buy viagra online without prescription cheapest prices on generic viagra cheapest viagra cheapest viagra prices cheap generic viagra cheap sildenafil citrate discount viagra canada email viagra get viagra no prescription get viagra without prescription low price viagra mail order viagra mastercard viagra order generic viagra order sildenafil citrate viagra 50/100mg viagra online without prescription viagra order online viagra sildenafil citrate viagra soft tabs viagra soft tabs for sale viagra soft tabs online viagra soft tabs without prescription buy viagra soft tabs cheap viagra soft tabs discount viagra soft tabs generic viagra soft tabs order viagra soft tabs buy cheap kamagra buy cheap kamagra online buy discount kamagra online buy online kamagra buy kamagra india buy kamagra online cheap kamagra cheap kamagra online discount kamagra discount kamagra online get kamagra online non prescription kamagra order kamagra order kamagra india order kamagra online kamagra for sale kamagra no prescription kamagra on line buy kamagra online no prescription best price for kamagra buy cheapest kamagra buy generic kamagra buy kamagra cheap buy kamagra cheap prices buy kamagra online without prescription cheapest prices on generic kamagra cheapest kamagra cheapest kamagra prices cheap generic kamagra discount kamagra canada email kamagra get kamagra no prescription get kamagra without prescription low price kamagra mail order kamagra mastercard kamagra order generic kamagra kamagra online without prescription kamagra order online