Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #27217

Re: Synchronous XMLHttpRequest deprecated

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Synchronous XMLHttpRequest deprecated
Date Tue, 07 Apr 2015 12:51:18 +0200
Organization PointedEars Software (PES)
Lines 78
Message-ID <4553250.RFBzHSfbcC@PointedEars.de> (permalink)
References <mfpsco$mn7$1@dont-email.me> <5521ac06$0$2891$e4fe514c@news2.news.xs4all.nl> <3049656.CVpVeAz9R9@PointedEars.de> <5523844e$0$2868$e4fe514c@news.xs4all.nl>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace solani.org 1428404001 8283 eJwFwQkBwDAIA0BLwHiCnBYa/xJ2F19qTnlGejAIXHWSy7M1663GVLwWQ8sUcRNmZ2498bUfLbQRcw== (7 Apr 2015 10:53:21 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Tue, 7 Apr 2015 10:53:21 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwYEBgDAIA7CXhtBCz2EK/59gAqfxzSAYWOy5q2N2Z24rur62qWhxpRlPxHnUOJbiZIRnlS9nHhKAflg0FMg=
Cancel-Lock sha1:jrbzlTWY7fX1hotwm/w1siH80o0=
X-NNTP-Posting-Host eJwFwYkRwDAIA7CV7AuPGScpsP8IlfwE40sLD/P1HfUwDdu+lxI2IZJiqZJdb85xLKL0MPcHEZ4Qfw==
Xref csiph.com comp.lang.javascript:27217

Show key headers only | View raw


Silvio wrote:

> On 04/06/2015 02:11 PM, Thomas 'PointedEars' Lahn wrote:
>> They who can read have the advantage here.  It is a *warning*, not an
>> error message.  The developer can disable the display of warnings.
>> They do not even have to use the Console.
> 
> The warning is not the problem. But the underlying sentiment is that the
> feature is benign

Gibberish.

> and it expresses at least the desire to remove the feature at some point.

Non sequitur.  It says that those requests *in the main thread* are 
deprecated.

>> I do not see your point.  Why exactly can that not be done in a user-
>> friendly, non-blocking, asychronous way?
> 
> Chrome, Safari, IE and Firefox all consider a window.open or
> window.alert from asynch response handler code (i.e. not user initiated)
> to be a 'popup' and will block it by default.

True.

> That is far from user-friendly.

*Popups* are not user-friendly, which is why they are blocked by default.

> If the synchronous request is part of user initiated code then the code 
> handling the response is still user initiated and does not suffer from 
> this disadvantage.
> 
> The notion that a synchronous request on its own is not user-friendly is
> nonsense. That is only the case if it takes long to complete. That is
> something the programmer can make so unlikely a user is not affected.

No, the programmer cannot foresee how long it takes a server to respond.

>> It has been the standing recommendation for several years now, here and
>> elsewhere.
> 
> I know

Then why are you asking?

> but I have never seen good arguments for the recommendation, only
> people echoing what some browser devs once yelled.

Your short attention span and/or insufficient research is *your* problem.  
The fact that synchronous request handling in the main thread *blocks* the 
browser and effectively *prevents the user from using their software*, or
at least a browser tab or window, until the response is received, and that 
asynchronous request handling does not have that disadvantage, sounds like
a good argument to me.

> Forcing a sufficiently short (user configurable) timeout on a
> synchronous request would be easy to do and would only break cases that
> are indeed not user friendly.

You cannot know if the timeout occurred because the server could not respond 
in time or because it could not respond at all.  How many synchronous 
requests are you going to make in order to find out, blocking the user with 
each one?
 
> No limit is imposed on how long event handling code may run but when it
> does a synchronous event then that is considered bad. I see a lot of
> crummy web pages that behave hostile towards users by means of embedded
> JS. Hardly ever are synchronous requests the culprit.

That does not mean it is a good thing.  Your logic is flawed.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Synchronous XMLHttpRequest deprecated Chuck Anderson <seemysig@thisis.invalid> - 2015-04-04 17:34 -0600
  Re: Synchronous XMLHttpRequest deprecated Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-04-05 08:09 +0800
  Re: Synchronous XMLHttpRequest deprecated Luuk <luuk@invalid.lan> - 2015-04-05 18:06 +0200
    Re: Synchronous XMLHttpRequest deprecated "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-04-05 10:42 -0700
      Re: Synchronous XMLHttpRequest deprecated Luuk <luuk@invalid.lan> - 2015-04-05 22:04 +0200
    Re: Synchronous XMLHttpRequest deprecated "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-05 22:59 +0200
      Re: Synchronous XMLHttpRequest deprecated Chuck Anderson <seemysig@thisis.invalid> - 2015-04-05 23:09 -0600
        Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-06 10:20 +0000
  Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-05 23:41 +0200
    Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-06 14:11 +0200
      Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-06 13:23 +0000
        Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-06 15:36 +0200
          Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-06 18:26 +0000
            Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-06 20:18 +0200
            Re: Synchronous XMLHttpRequest deprecated Denis McMahon <denismfmcmahon@gmail.com> - 2015-04-06 18:35 +0000
              Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-06 21:51 +0000
                Re: Synchronous XMLHttpRequest deprecated "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-06 23:33 +0200
              Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 01:13 +0200
      Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-07 09:16 +0200
        Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 12:51 +0200
          Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-07 14:55 +0200
            Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-07 14:23 +0000
              Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-07 17:41 +0200
            Re: Synchronous XMLHttpRequest deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 15:37 +0200
              Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-07 16:53 +0200
                Re: Synchronous XMLHttpRequest deprecated Tim Streater <timstreater@greenbee.net> - 2015-04-07 16:03 +0000
                Re: Synchronous XMLHttpRequest deprecated Silvio <silvio@internet.com> - 2015-04-07 17:47 +0200

csiph-web