Hello,

on 04/08/2006 10:53 AM Ryan A said the following:
> Carlin Bingham / Tedd:
> -----------------------
> Yes, but then I would have to reload the whole page just to tell the person
> that the account username was already taken...thats how its "traditionally"
> done...but I want to try doing it without reloading the whole page...hence
> Asynchronous JavaScript And XML (AJAX) although the XML part at the end is
> not really too accurate because from what I see you can (and i have) use
> AJAX without any XML...in my case it would be AJAH or AJAT (H=HTML, T=TEXT)
> :-p

There is a misunderstanding here. The X does not necessarily means
generic XML. It may mean XHTML. Anyway, an AJAX request may server any
type of data.

Another point is that AJAX does not mean necessarily using
XMLHttpRequest objects . As you may read in the Wikipedia definition,
many AJAX frameworks use IFrame.

http://en.wikipedia.org/wiki/Ajax_%28programming%29

There are certain things that it is not possible to achieve with
XMLHttpRequests, like form file uploads .

Other than the fact that ActiveX may be disabled, XMLHttpRequest objects
are often inneficient and slower. For instance, if you want to execute
some action that may take some time on the server, you cannot give any
progress feedback in the same request because the response of a
XMLHttpRequest is only available to the browser when it is completely
received.

OTOH if you use an hidden IFrame based solution, you can start sending
the response right away, and use <script> sections with Javascript to
start executing one or more actions on the browser even before the
server has finished to execute its task. This is very good to give
progress feedback.

You simply can't do that with XMLHttpRequest. Even if you keep polling
the server repeatedly, it is not the same thing as making it all with a
single request as you can with hidden IFrame, and you waste bandwidth
and impose additional server load.


> The other thing is, I thought I would start with something simple but still
> real world and then work myself up to more complex stuff.... thats how I
> learnt PHP; even though I didnt start with the "Hello world" in PHP I
> started with basic strings and with the help of a book (PHP Blackbook) and
> this list (better than any book) I rarely program in anything other than PHP
> now.

That is why I suggested that to take a look at the test_ajax_form.php
example of this forms package:

http://www.phpclasses.org/formsgeneration


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to