30 seconds AJAX

July 29th, 2005. Tagged: Ajax, JavaScript

PHP's creator Rasmus Lerdorf has posted a message on the PHP-General mailing list. It's a 30 seconds AJAX tutorial and is a response to a question about using PHP and AJAX.

Yours truly recently published an intro to AJAX on Devmo (second part is coming up, stay tuned 😉 ) so I couldn't help but look at Rasmus' email with a critical eye. Well, there are a few bits that a modern hardcore javascripter might dislike, like for example
if(browser == "Microsoft Internet Explorer"){... (browser sniffing as opposed to feature sniffing)
<a href="javascript: ... (javascript is not a protocol)
or the use of innerHTML (an HTML document is a tree of nodes, not strings)

But overall, it's a nice, short and clear intro. And I do like the message as a simple reminder that we should think in terms of the task to be performed, not in terms of the solution, I mean not to rush into using a PHP-AJAX lib, just because, but to try and see if there's an easier and simpler way.

As a side note, that's the beauty of Rasmus' PHP -- it's designed to solve a problem, the web problem, and it's doing this in a very good manner. PHP was not designed to be, for example, the best OO language ever or something. It was just a set of CGI programs to help their creator (and all the world later on) solve web problems. Afterwards, with the help of the web dev community, PHP grew up to become the programming language it is today.

Tell your friends about this post on Facebook and Twitter

Sorry, comments disabled and hidden due to excessive spam.

Meanwhile, hit me up on twitter @stoyanstefanov