Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.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: Prevent refresh when url returns from another app. Date: Thu, 30 Apr 2015 08:25:59 +0200 Organization: PointedEars Software (PES) Lines: 34 Message-ID: <3353818.0hvg7bqIvD@PointedEars.de> References: <6f5a2e3a-36ce-4887-809c-dd9f829a054a@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1430375307 16085 eJwNxMkBwCAMA7CVmsMOHYeaZP8RqB5C0KhKgonBJMcNyKbtM6E2EaXg8bC1nlHDlbnfr/R3ARWXETA= (30 Apr 2015 06:28:27 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 30 Apr 2015 06:28:27 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwQkBwDAIA0BNtCFlcvjiX8Lu/NLYD3TC5WJfy3pytrnNsciNrmgV91Tm7jA/IO+GRKDhx4WckRY/e1UXEw== Cancel-Lock: sha1:5PxTyGBI02g3oUIFDhIayjOu47E= X-NNTP-Posting-Host: eJwNykkRwAAIBDBLpbALyGE4/Eto8w6UwnYjaDic4CHWB13IuoFnTQvf3WilXmCr4g+WoMwHIgQRSA== Xref: csiph.com comp.lang.javascript:27426 Joao Rodrigues wrote: > On 28/04/2015 19:02, Evertjan. wrote: >> Amandeep wrote on 28 apr 2015 in comp.lang.javascript: >>> So, is there a way where I can retrieve the bar-code from the url >>> without refreshing the page.(So that the input fields retain their >>> values). OR how can I retain the values entered in the input fields. >> var xhr = new XMLHttpRequest(); >> ...etc. >> forms[0].elements['myInput'].value = result; > > Or the HTML5 Fetch API, supported in recent versions of Firefox and > Chrome. And Opera. But: | This is an experimental technology | Because this technology's specification has not stabilized, check the | compatibility table for […] use in various browsers. | Also note that the syntax and behavior of an experimental technology is | subject to change in future versions of browsers as the spec changes. In this case, “recent” means only the most recent stable versions have support for it enabled by default, namely Chrome 42, Firefox 39, and Opera 29. I recommend to not use it for Web sites on the Internet at least at this point. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.