Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Synchronous XMLHttpRequest deprecated Supersedes: <4205253.lZmTOYxaui@PointedEars.de> Date: Tue, 07 Apr 2015 01:13:15 +0200 Organization: PointedEars Software (PES) Lines: 38 Message-ID: <2719713.BApv8GKvXd@PointedEars.de> References: <5521ac06$0$2891$e4fe514c@news2.news.xs4all.nl> <3049656.CVpVeAz9R9@PointedEars.de> <060420151323054349%timstreater@greenbee.net> <1787376.QsvDXBBI4c@PointedEars.de> <060420151826574912%timstreater@greenbee.net> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1428362119 21189 eJwFwQkBwDAIA0BLSyGB2imPfwm7owmqcFHO5erdlDYt26dwpuMCdb8ecjPIxjO3znfCgB8VGhCG (6 Apr 2015 23:15:19 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 6 Apr 2015 23:15:19 +0000 (UTC) User-Agent: KNode/4.14.2 Cancel-Key: sha1:AUrcL4UXmEdXYEvCLAdzrf1+xqg= X-User-ID: eJwFwYkBwEAEBMCWcCzK8UT/JWTGHhjjCoPa2eEMlUtL5co6QSWPo0OiV4c2+UNwjbg8+BImqVPa52Tm+wFBWRVX Cancel-Lock: sha1:IjjP1zx1/DeKJIGT4vhAkP6tfUw= X-NNTP-Posting-Host: eJwFwQERADEIAzBLz6DlkMN46l/CEjiNk0EwIOiKa95QFS5bSMVv5WJbzrfqs50xFceK1Q8tKRFy Xref: csiph.com comp.lang.javascript:27214 Denis McMahon wrote: > On Mon, 06 Apr 2015 18:26:57 +0000, Tim Streater wrote: >> Gee, I'll have to smack those users harder, then, so they don't click on >> the little red X in the top corner of the window. > > I guess that technically what you should do is redesign the browser UI > component and the back end so that the back end data is never in an > inconsistent state ..... > > I know, it's a lot easier said than done. Appeal to ridicule. Christoph has already made a good suggestion. There are other possibilities to not having to use the *user-unfriendly* synchronous XHR, but they depend on the use-case. For example, if you wanted to make sure that a user is logged out, you could keep a server-side session alive in the background (using asynchronous XHR if possible, an image or a reloading hidden frame if necessary) and end it automagically when there is no further request (by short session lifetime). And on the client-side, you can use a session cookie or Session Storage. It should also be noted that Firefox/Gecko is unique in its behavior of purportedly trying to be “user-friendly”. This can have unforeseen consequences. For example, there is no good reason why I should not be able to request fullscreen mode from a timeout, why I should get the following warning instead if I first wanted to play a sound from a HTML5 audio element, then request full-screen: | Request for full-screen was denied because Element.mozRequestFullScreen() | was not called from inside a short running user-generated event handler. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.