Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32300
| From | Jake Jarvis <pig_in_shoes@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Read in file to array. |
| Date | 2017-01-24 17:42 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <o68034$fje$1@dont-email.me> (permalink) |
| References | (10 earlier) <1863dd79-c818-446e-8720-6db25d522ea8@googlegroups.com> <87sho9v7hj.fsf@bsb.me.uk> <2542f4ea-03ea-4c27-88d4-6c7a49854e21@googlegroups.com> <87d1fcttwu.fsf@bsb.me.uk> <91deb8b3-36f6-4513-a2b5-abf229efb6fb@googlegroups.com> |
Am 24.01.2017 um 17:24 schrieb jonas.thornvall@gmail.com:
> Den tisdag 24 januari 2017 kl. 15:27:33 UTC+1 skrev Ben Bacarisse:
>> jonas.thornvall@gmail.com writes:
>>
>>> Den måndag 23 januari 2017 kl. 21:36:45 UTC+1 skrev Ben Bacarisse:
>>>> 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:
>> <snip>
>>>>> 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.
>> <snip>
>>> Well it bascily working,
>>
>> Ah, OK. That's another reason you may not get many responses. You post
>> so many followups to yourself that people might get the idea you post
>> first and investigate later. Anyone looking at a problem might feel they
>> are wasting their time since you'll fix it yourself in the man time.
>>
>> I see you posted more code with no URL.
>>
>> <snip>
>> --
>> Ben.
>
> Well i don't think it is a bug problem the problem is that i do not understand how the invoked function do work. I simply do not get how a variable within the invoked function "textFromFileLoaded" manage to write the data to a textarea. But when i try to use it after the invoked? function code it is undefined. So as you can see i tried to copy it to a global variable mytext. Problem is when mytext is called after the function it is undefined.
>
> So i understand, that i just do not understand how this type of invoked functions work, in any normal case the global variable mytext could not be undefined. I have not the faintest idea what is going on, so there is nothing to look for.
>
> function o_gush(){
> etc
> fileReader.onload = function(fileLoadedEvent)
> {
> var textFromFileLoaded = fileLoadedEvent.target.result;
> document.debug.data.value = textFromFileLoaded;
> mytext=textFromFileLoaded;
> };
> fileReader.readAsText(fileToLoad, "UTF-8");
> **do** something withh mytext----->undefined WHY????????????????? It wrote to textarea usin textFromFileLoeded yet neither textFromFileLoaded nor mytext exist outside paragraph?????? Well unless you load again..........
> etc}
>
Have you considered sprinkling your code with some debug messages, so as
to make sure the flow of the program is what you think it ought to be?
When you write "try to use it after the", what do you mean exactly?
Time or location?
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 03:29 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 03:59 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 06:26 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 07:41 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 08:08 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 08:43 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 09:41 -0800
Re: Read in file to array. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-01-23 10:29 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 11:24 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 11:38 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 11:56 -0800
Re: Read in file to array. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-23 20:36 +0000
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 19:54 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 20:10 -0800
Re: Read in file to array. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-24 14:27 +0000
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 08:24 -0800
Re: Read in file to array. Jake Jarvis <pig_in_shoes@yahoo.com> - 2017-01-24 17:42 +0100
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 08:54 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 09:04 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 11:07 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 13:17 -0800
Re: Read in file to array. Tim Streater <timstreater@greenbee.net> - 2017-01-24 21:35 +0000
Re: Read in file to array. Jake Jarvis <pig_in_shoes@yahoo.com> - 2017-01-24 22:42 +0100
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 15:32 -0800
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 15:55 -0800
Re: Read in file to array. Tim Streater <timstreater@greenbee.net> - 2017-01-25 08:59 +0000
Re: Read in file to array. Jake Jarvis <pig_in_shoes@yahoo.com> - 2017-01-25 01:58 +0100
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-24 18:51 -0800
Re: Read in file to array. Jake Jarvis <pig_in_shoes@yahoo.com> - 2017-01-25 10:29 +0100
Re: Read in file to array. Tim Streater <timstreater@greenbee.net> - 2017-01-25 08:58 +0000
Re: Read in file to array. jonas.thornvall@gmail.com - 2017-01-23 12:28 -0800
Re: Read in file to array. Tim Streater <timstreater@greenbee.net> - 2017-01-24 17:21 +0000
csiph-web