Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Read in file to array. Date: Mon, 23 Jan 2017 20:36:40 +0000 Organization: A noiseless patient Spider Lines: 38 Message-ID: <87sho9v7hj.fsf@bsb.me.uk> References: <2b6a77ee-b20d-4f11-bd56-c73f66523ec7@googlegroups.com> <015aa987-b329-446c-9fb9-b7c1317a7a39@googlegroups.com> <30277451-ca92-4bc3-b070-3ed4fd8d2dfc@googlegroups.com> <191ace72-7818-44ca-9dae-d0499239f132@googlegroups.com> <8faaf70c-8e7b-4dc5-a023-9ce2d2996c2c@googlegroups.com> <931577e5-a727-4243-99af-d0b436760cc8@googlegroups.com> <2fd047d8-bee3-4192-8c4a-799c84d6876c@googlegroups.com> <4d6a078b-9944-4244-8fb6-d5b23ed42635@googlegroups.com> <1863dd79-c818-446e-8720-6db25d522ea8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="2df1bad811653ba1e706494cd1d3929e"; logging-data="5763"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pDdFIUEVsKfTm/Sa6IHkBr4TKZAubJQ4=" Cancel-Lock: sha1:1KpAfX5kJSsW23LZqp9K+qWXve8= sha1:z99NQ59YCLbgB2J6okRrPgiFHwk= X-BSB-Auth: 1.b447e180912e48961a9b.20170123203640GMT.87sho9v7hj.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:32280 jonas.thornvall@gmail.com writes: > Den måndag 23 januari 2017 kl. 20:39:06 UTC+1 skrev jonas.t...@gmail.com: >> Den måndag 23 januari 2017 kl. 20:24:35 UTC+1 skrev jonas.t...@gmail.com: >> > Den måndag 23 januari 2017 kl. 19:29:54 UTC+1 skrev Michael Haufe (TNO): >> > > jonas.t...@gmail.com wrote: >> > > >> > > > [... code ...] >> > > >> > > copy and paste your JavaScript into here and fix the problems you see: >> > > >> > > >> > >> > Well i think i can see what is going on but i just don't understand the inline functions within functions. >> > What i probably wan't is to make textFromFileLoaded visible outside the {} paragraphs, but i am a bit lost i really do not understand this code. >> > >> > I find it strange though that i can not define a global variable mytext and copy textFromFileLoaded to it? And why does it work the second time. >> > >> > fileReader.onload = function(fileLoadedEvent) >> > { >> > textFromFileLoaded = fileLoadedEvent.target.result; >> > document.debug.data.value = textFromFileLoaded; >> > mytext=textFromFileLoaded; >> > >> > }; >> >> But the good part load graph works i just have to push load button two times ;) > > This is my "working with two loads" code but if someone straight away > can say the cause why i can't load mytext first time and it say > undefined or howto use textFromFileLoade outside the brackets > "function?", i am all ears. Have you posted a link to a site that exhibits the problem? Code snippets are unlikely going to get anyone tor reply. -- Ben.