Friday, November 19, 2010

First encounters with Ajax

After several hours of playing around with Ajax, I am finally starting to feel comfortable with it. The chapter HTTP Requests from Eloquent JavaScript is very good for beginners. Then, for more examples and to work with other formats, I have referred the Ajax chapter from jqfundamentals.

I should really thank firebug, for without it many things could have been tedious. I have used plain text, html, JSON, JSONP formats to exchange data till now. As I wanted to work with Python, I created a simple HTTP server (using BaseHTTPServer) to go through the basics tutorials. Then, I have used the appengine devserver to go ahead. In the process, I have also learned about the json module in Python(from 2.6) and simplejson which is the same but can be used for Python 2.5. On Google App Engine, it can be imported using from django.utils import simplejson.

Initially, I was creating the landing page for my experiments using the get method of a requestHandler class. It was difficult to edit the html code that way. Then, I felt like an idiot when it dawned upon me that I could just use a static html file. Many small lessons along the way made me happy. Editing HTML, JavaScript in vim wasn't easy (out of the box). I expect it to be better after some tweaking around.

After all the coding I have done over the last two days, I feel a need for a code blog. I have been thinking about buying a custom domain and host a personal website using a Python based CMS. Until then, I think I can use a wordpress.com blog or github pages. This blog can continue to be my learn log.

No comments:

Post a Comment