Writing a Reusable AJAX Handler

October 09th, 2008 | Category: Game Development, JavaScript, Web Development

Due to the number of questions I receive on various forums as well as the number of times I have run into the need for an AJAX response handler in my own work, I decided I would share one of my solutions in the hopes that it will save someone else some time as well. I assume, if you are reading this, that you have a basic knowledge of AJAX and the principles guiding the technology. In addition, basic understanding of how libraries such as jQuery perform AJAX queries and callback functions in JavaScript is a plus. For further reading on these prerequisites, check out this Google search and the jQuery docs.

After manually handling my responses in multiple projects, I finally decided to write a JavaScript object that could handle the XML responses for me and return me a usable object to my callback function. Enter the AJAX Handler object. I decided to let jQuery handle the actual requests for me, but I wanted a way to easily parse out my response, checking for errors and handle them accordingly. The result was something I have been able to use numerous times in different projects. To simplify things, let’s look at the code a piece at a time. At the bottom of this post, you will find the entire code. Read more

No comments

Tactics RPG via Google App Engine

October 08th, 2008 | Category: Game Development, Programming, Web Development

Tactics RPG screenshotWhile somewhat old news to some, the Google App Engine is an amazing tool allowing developers to tap into the scalability offered by the Google framework while developing entirely standalone applications. What’s more, along with the offer of the code base to build from, Google also allows developers to host their projects, at no cost, on the Google App Engine server (up to 10 applications per user, no less). I was excited to learn of the project initially, and the more I have delved into it, the more enthralled I have become.

For years now, I have wanted to have the means by which to develop a small tactics style RPG game, and while I have had the basic coding knowledge needed (not to mention buckets of ideas), it has been difficult to bring myself to the point of actually taking on such a daunting task. Having the opportunity to build on the data store and framework Google has offered with their App Engine has given me that extra little boost to begin development on one of my long time goals. Read more

2 comments

Google Resources Abound!

May 19th, 2008 | Category: JavaScript, Web Development

I have always been a fan of Google’s products as I have been made aware of them, and on very few occasions have I had anything negative to say about them. I recently have started using yet another assistance provided by Google that is, in my opinion, one of the single most helpful and creative tools to be offered free of charge to the development community. I speak of none other than the Google Web Toolkit. This Java application allows you to build quite extensive AJAX utilities from within the tool itself. What I find very interesting about it is that you literally write your application in Java (using a GUI that is provided with the Toolkit, if you choose), and the Toolkit then generates your markup and JavaScript for the final product.

Read more

No comments

JavaScript Libs and OOP

May 13th, 2008 | Category: JavaScript, Web Development

Those of you who work on client side scripting to any degree (XHTML, CSS, JavaScript, etc) are probably well familiar with some of the more common JavaScript libraries available. I have looked into different ones to some degree, and I have used a handful of them extensively before settling on one that best fits my needs. You see, as a developer, I love to conceive of my own patterns and objects to do things within my page, but I also don’t like having to delve into the innermost workings of the DOM unless absolutely necessary for optimization. This being said, for large scale applications like Content Management Systems (CMS) or administration panels, I like to use a themed, all inclusive solution like the Yahoo! User Interface Library (YUI) or ExtJS (an extension of YUI); however, when working with basic DOM manipulation or personal projects that require a lightweight solution, I have become enamored with the jQuery library.
Read more

No comments