Re: Ajax please....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

on 04/08/2006 04:23 PM Ryan A said the following:
> Hey,
>
> <clip> 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.
> </clip>Hmmmm, I guess I forgot about the X in XHTML, but if you look
on the
> SEs most of theresults for AJAX come up with X being XML...maybe thats
what
> the idea was in the beginning?

That is because last year Jesse James Garrett coined the AJAX term as
something that uses XMLHttpRequest object, but if you know that object,
you know that it can make HTTP request that return any type of data.



> <CLIP>
> 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.</CLIP>
> Actually, in my search for AJAX on google, I did find some ways that
you can
> give the user a waiticon or some feedback while you are doing something in
> the background....You might be interested in this:

You are missing the point. If you want to perform a lengthy task, say
send a newsletter to thousands of users, the wait icon has nothing to do
with AJAX and is a very limited form of feedback.

Using IFrame not only the server can perform the task and at the same
time update the browser to tell how much of the task has been performed
and give an estimate of how much time is remaining, updating that
progres feedback regularly with accurate figures from the server.

You can't achieve this with a single XMLHttpRequest in the same request
that starts and runs the lengthy task.


> http://www.sergiopereira.com/articles/prototype.js.html looking viagoogle
> you should find other links...also dont forget Gmail has some real
good live
> working ajaxexamples as you login there including a very good ajax file
> upload system...check it out.

FYI Gmail uses IFrames extensively.

Anyway, the point about file upload restriction is that it is impossible
to send files via XMLHttpRequest. For security reasons Javascript code
cannot have access to the contents of the files in the user disk.
Without that, you cannot compose and send a HTTP request with
XMLHttpRequest object.

As with IFrame you do not need to access the contents of the files. You
just need to set the target of a form with an file upload input to point
to the IFRAME id and then submit the form.

Not only this is a viable solution to upload files, but it takes much
less Javascript code to execute.


-- 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux