Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

AJAX and JSON

I have been writing simple Ajax applications for a while now. Up to now I have stuck with procedural JavaScript that fetchs raw HTML and inserts it in the page. I knew these methods were lacking, but I used them for quite a while anyway. I started reading about how to write Object oriented JavaScript. I don't what took me so long to look into it. I've been using OO in C++ for about 10 years, and PHP for 3 years. I'm a big fan of objects. So tonight, I decided to write an Ajax object as part of a bigger scheme to buld myself a useful library for doing net stuff. I ran into some problems using a callback function for the xmlhttp response, but I figured it out. Next I started reading about parsing XML and JSON. I decided to try JSON since it sounded easier. I made a PHP class that converts an array of derived classes into a JSON object. I made a simple callback to parse the object on the client side, and write some boxes full of fake data into the page. Now everything is in place to use in a real application. I think I'll start with making an AJAX file/directory browser for a PHP project management system I'm developing. Then there are plenty of things I want to ajaxify.



This post first appeared on Just A Moment..., please read the originial post: here

Share the post

AJAX and JSON

×

Subscribe to Just A Moment...

Get updates delivered right to your inbox!

Thank you for your subscription

×