Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.javascript Subject: Re: Synchronous XMLHttpRequest deprecated Date: Mon, 06 Apr 2015 23:33:30 +0200 Organization: solani.org Lines: 31 Message-ID: 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> <060420152151514096%timstreater@greenbee.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1428356010 32099 eJwFwQkBACAIA8BKDmFIHOXpH8E72wTTlUa1salQsJf3ILWwdnuhrkCSpSI5L8azGYzD0x8f7hFA (6 Apr 2015 21:33:30 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 6 Apr 2015 21:33:30 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 X-User-ID: eJwFwQkBwDAIBDBL4wc5FDj/EpaYOPmEurkaDLpSMH3BDO/xSkyjs5BLV685Phm7pMg9ih8osBF+ In-Reply-To: <060420152151514096%timstreater@greenbee.net> Cancel-Lock: sha1:nixkwlaOwiqyy7zhnazBORV1f0E= X-NNTP-Posting-Host: eJwFwQkBwDAIA0BLUJ4QOQxW/xJ6F5aaA89Ijxv3BwOz33HRPWaSUgtV5EFz1ZvVI0Maa8wfBPgQGQ== Xref: csiph.com comp.lang.javascript:27212 Tim Streater wrote: > In article , 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. > > That would mean, for instance, that if (as I do) I have a data entry > area into which the user has typed a load of stuff, and I want them not > to lose that if they close the window, I'd have to be more or less > sending every keystroke to the backend. Remember, once they click on > the little red +, the window is going away whether I like it or not. > > Personally I prefer a more pragmatic approach. A simple solution would be to use the beforeunload event to signal to the user that there are unsaved changes, giving him/her the chance to stay on the page (i.e. this document), and to save the changes if desired. -- Christoph M. Becker