Richard Lynch wrote: > On Thu, July 21, 2005 3:50 pm, Rasmus Lerdorf said: > >>I find a lot of this AJAX stuff a bit of a hype. Lots of people have >>been using similar things long before it became "AJAX". And it really > > > Call me silly, but... > > Didn't a LOT of us move a bunch of code to PHP instead of JS because JS > was so flaky, because browser implementations were so... diverse..., > because you never knew if the user even *HAD* javascript, really, and you > just didn't want to rely on it? > > Is anybody going to claim that any of the fundamental problems with > client-side scripting have changed? Got a bridge to sell, too? > > If it's just eye-candy, and doesn't matter to the functioning of your > web-site, go for it. > > If you NEED it to work, JS is simply not the right way to go, even with > today's landscape. Browser technology has advanced a bit since then. Today we are no longer dealing with a pseudo-SGML hack called HTML like we were 10 years ago. Today's web browser is a DOM Tree viewer. In Firefox you can click on Tools->DOM Inspector and click through the tree of the page you are on. The language to manipulate this DOM Tree is Javascript. And yes, Javascript gets this DOM manipulation right, because it is so closely integrated with the actual parsing of the tree. If it didn't work, the browser wouldn't work either. For example, take this JS: foo = document.getElementById('some_id').value; This obviously gets the value of the field with some_id. This prods the same DOM tree with the same code that the browser itself uses when it wants to know what the value is in a given element of the tree. So at this level Javascript is fine, and yes, you can count on it working in all modern browsers. If any of them can't do this, they won't be around long. It gets a bit dicier when you try to extend out beyond simple document manipulation, but that is really no different than trying to push the boundaries of CSS or trying to get IE to speak CSS2. The bar keeps getting raised. In my opinion it has been raised well above basic Javascript for quite a while now. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php