Archive for the 'JavaScript' Category

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

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

On Internet and Gaming

May 15th, 2008 | Category: Game Development, JavaScript, Programming

Well, those of you who know me in the least are aware of my passion for video games. I have, quite literally, been a fan of console and PC gaming for as long as I can remember. My parents will vouch for the fact that, on my fifth birthday — before I could read — I was situated in front of our living room TV set with our TI-99/4A on my lap, an open code book next to me, pecking character by character until I had basic animations appearing on the screen. I vaguely remember those details, although I can remember playing games like Parsec and Hunt the Wumpus, but the passion for gaming is still there to this day.

My focus, however, has shifted from simply being a placid gamer to wanting to delve more into the inner workings of the game development process and the gaming industry in general. Choosing web development as a career path has given me more of an insight into the principles that make games work, and I greatly admire those with the knowledge and fortitude to stick with it during the grueling development process, but I still have that burning desire to be more actively involved in the industry in some way.
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