I was excited to read the AJAX: Usable Interactivity with Remote Scripting article by Cameron Adams in the hope of finding out out a lot more about AJAX, particularly how to actually use it! The article is very good, but is written as a usability guide rather than a technical howto about how to use AJAX within your own applications. Granted, I haven’t looked much, but tutorials for making use of AJAX with PHP seem to be lacking (do you know of any good ones?). So I went to Google and searched to see what I could come up with, hoping I’d find some kind of stuff Ruby has.
The first thing I came across was SAJAX which looks pretty good, although I didn’t stop to have a closer look. Next I found a PHPBuilder tutorial, which had some links in the comments, one of which was CPAINT.
I downloaded CPAINT because it looked very interesting and designed with PHP (and ASP) in mind. Reading the documentation that comes with the download, this does seem to be true. It even provides functions to generate the XML. It is certainly something I will look at again in the future if I ever decide to use AJAX. There are some people who think that AJAX is used too much!
Related posts:
- Are You Violating the Eolas Ajax Patent? It's true: Eolas has an Ajax patent and is filing...
- Installing PHP on Windows Just Got Easier Have you ever felt frustrated when setting up a PHP/MySQL...
- Ready for PHP & MySQL Week at SitePoint? To celebrate the release of the new edition of well-loved...
- 16 PHP Frameworks To Consider For Your Next Project Why spend valuable time coding everything by hand? Using a...
- Introducing php-tracer-weaver php-tracer-weaver is a tool for automatically generating docblock comments, with...







Start reading the blog! That’s really strange. Harry has posted about working with XMLHttpReq last year – before someone called it AJAX. And now you go outside to find what you could find just in the same blog?
The project Harry made is called JPSpan and can be found here: http://jpspan.sourceforge.net/ He even has a great wiki there.
b4n
July 24th, 2005 at 7:12 am
The reason that I’m not a fan of AJAX is because of its lack of cross-browser compliancy. I haven’t dabbed in it myself, but I have ordered DHTML Utopia, so I should learn soon!
July 24th, 2005 at 8:53 am
Yes Nico, Harry did indeed cover XMLHTTP last year. I thought I’d post some more about Ajax because it is now much more well known and therefore there are likely to be more libraries available. JPSpan didn’t come up in my Google search but I’m glad you have pointed it out because it looks pretty good. Thank you.
July 24th, 2005 at 10:10 am
script.acul.us is not for Ruby. It doesn’t have anything to do with a server-side language. It’s a javascript library, pure and simple.
Yes, Rails (framework, not a language) has helper functions that interact with the library, but nothing’s stopping anyone from doing the same in PHP.
July 24th, 2005 at 4:33 pm
The CakePHP-project (which is based on the Ruby On Rails concept) has made use of the prototype library (also used by the Rico-project) and it implements some ajax-functionality. Using the prototype library makes it easier to implement ajax-functionality, and makes it cross-browser compatible. The Rico-project has done this and come up with some modules which they think of as useful for us. I still suggest starting of looking at the Prototype-library before peeking at the Rico-project.
The CakePHP-project in itself is also promising. Hopefully they will get around to creating good helper methods for the AJAX-functionality. Until then, the prototype lib and Cake is just sitting there, waiting to be used, like this guy shows.
July 24th, 2005 at 6:28 pm
I have used sajax on several projects and haven’t ran into any problems. The nice thing about sajax is the multiple languages and ease of use. I program in coldfusion at work and php on the side and it works great with both.
July 24th, 2005 at 11:58 pm
I’m still baffled as to why anyone would need a special api or whatnot to use these technologies. Here is what you do:
1.) Make a request using xmlhttprequest in javascript to a server-side php script.
2.) Make the php script process the request and return an xml file with the data.
3.) Have the callback function (provided when you called xmlhttprequest) run through the returned data and do whatever is appropriate with it.
The existing toolkits and apis for it are so completely unnecessary and overdone that it makes me want to cry. It’s actually slower and more difficult to use most of them than it is to just write the code yourself.
July 25th, 2005 at 2:42 am
Etnu, I presume you feel the same way about database abstraction layers?
July 25th, 2005 at 3:56 am
Im surprised no one mentioned JSRS… it’s by far my favourite out of the bunch so far.
jnunemaker: im wasn’t ever able to get sajax working correctly… what’s the secret ;)
Etnu: i have to disagree with you… I think using a complete api and toolkit simplifies the process… Why write it all over when the toolkit can do all the grunt work for you?
July 25th, 2005 at 6:29 am
* What is AJAX?
* Why would I want to use it?
* What do you need to run it?
* XMLHttpRequest sounds like a marketing buzzword – what is it and why should I care?
July 26th, 2005 at 8:01 am
This site is a little odd. Ok it’s extreamly odd, but this is the most understandable AJAX tutorial out there.
http://www.webpasties.com/xmlHttpRequest/
July 26th, 2005 at 4:06 pm
I’ve used Sajax on http://www.tilika.com
The benefit is that a lot of the XML gymnastics are left to Sajax and you can focus on what you want to do with Javascript and your language of choice – mine is PHP.
July 27th, 2005 at 2:14 am
Apples to Oranges.
Databases: Enormously complex systems, each of which has unique interaction methods.
AJAX: A tiny communications layer to facilitate the transfer of data between a DOM document and a server application.
July 27th, 2005 at 3:18 am
I think the analogy is valid.
I’d wager that most coders utilising AJAX would write far more lines of code to do so than they do on DB tasks. In at least two different languages!
Also, the availability of AJAX testing tools is a long way behind what’s available for databases; meaning that the more code that you don’t have to write, the better.
July 27th, 2005 at 3:31 am
You use a mature toolkit because someone has experienced and generally coded around common issues such how to deal properly with latency. They also provide mappings from JS functions to PHP functions etc.
July 29th, 2005 at 3:11 am
the sitaution is a bit more tricky than when you use a DB abstraction layer!! firstly, not all browsers support XMLHttp, then the implementation of it varies from browser to browser(apparently IE vs Rest of them). then the issue is of cross-browser compatible parsing of data & output etc. like the Rico library gives you pre-defined methods and objects for several widgets like data-grids, drag-drop stuff etc. for which you’d write code again & again, so using a pre-made library that has already done most of the work for you & requires you make a few function calls to do the rest of the job, its a far better option.
however, each to his own preferences!! database handling in languages like PHP & ASP etc. isn’t that hard or complex, so there’s no real use for a DB abstraction layer if someone thinks like you!! ;)
July 29th, 2005 at 3:50 am
CPAINT v2.0.0 with many more features, greatly improved documentation, and security fixes was released today, if anyone is interested. We’ve also packed quite a few examples in there to get you going. Download it at Sourceforge.Net
August 19th, 2005 at 1:21 pm
AJAX is an exellent tool to make web pages for intranets and improve the user usability and in that case you don’t have to worry with the browser because you can specify the requirements for your system, so there is little to worry. I have used SAJAX it is a great toolkit but it didn’t work well with ADODB which I use it a lot so I found other versions that is OO and is based on the original script in the forum.
August 20th, 2005 at 10:01 am
çiçek gönder cicekclub e-reklamix ???
June 22nd, 2006 at 4:45 am