Re: =[xhr]

On Wed, Jul 23, 2014 at 4:49 PM, Paul bellamy <paul@appl.com.au> wrote:
> In the specification for XMLHttpRequest you posted a “warning” about using
> async=false which indicates that it is the intention to eventually remove
> this feature due to “detrimental effects to the user experience” when in a
> document environment.
>
> I understand that synchronous events retrieving data can, if not managed
> properly in the code, cause delays to the flow of the parsing and display of
> the document. This may, if the programming practices are poor, be
> extrapolated to be “detrimental to the users experience”, however there are
> times when there is a need to have data retrieved and passed synchronously
> when dealing with applications.
>
> In business application development there will always be the situation of
> the client needing to manipulate the display based on actions that retrieve
> data or on previously retrieved data. In these cases it is necessary for the
> data retrieval to be synchronous.
>
> If the document/form has to be resubmitted in full each time a client-side
> action is taken or the client needs to retrieve data to decide what action
> to take, then the user experience is definitely affected detrimentally as
> the entire document needs to be uploaded, downloaded, parsed and displayed
> again. Further there is the unnecessary need to retain instances of
> variables describing the client-side environment on the server-side.
> Variables which are not necessary for processing and should be handled by
> the client.

This last paragraph suggests that you don't really understand what
"asynchronous XHR" means.  You appear to be equating it with
submitting a form and loading a fresh page.

Async XHR just means that .send() returns immediately, rather than
pausing JS and waiting for the response to come back; the XHR object
then fires an event on itself when the response comes back, which you
have to listen for.

~TJ

Received on Friday, 25 July 2014 17:45:20 UTC