The New Boston Ajax Tutorials 1-11

I thought I would take a look at learning Ajax, I’m still not completely sure what specifically defines a program to be Ajax aside from communicating and live updating client side and server side.

What did I learn from the first 11 tutorials?

index.html – When loading the web page automatically load the js in the head and call the method in the body that is used to communicate with the server running php. Add the ui elements to collect input with appropriate ids.

establish communication with server via js – 3 steps.

  1. Create xmlHttp object for communication – this is either an ActiveX object with IE or XMLHttpRequest() with chrome or firefox
  2. Create the process method that uses the xmlHttp object to communicate with the server
  3. Handle the server response depending on the xmlHttp readystate

I ran into a few bugs.

I’m not familiar with XML, I need to understand the response tags better.

When defining the xml version in near the top of foodstore.php there was a space in the string between UTF and -8 that was giving me a parsing error.

My page was not updating automatically, it required a page reload to register any change. Turns out this was caused by a bug in my php code within my xml response tags. The code was obviously hitting a wall but I was not getting an error, perhaps I can kick back events or exceptions.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s