Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38559 > unrolled thread

Hoe can i read..

Started byRobert Baer <robertbaer@localnet.com>
First post2020-07-20 16:33 -0700
Last post2020-07-26 14:42 +0000
Articles 6 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  Hoe can i read.. Robert Baer <robertbaer@localnet.com> - 2020-07-20 16:33 -0700
    Re: Hoe can i read.. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-07-21 02:04 +0200
    Re: Hoe can i read.. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-07-20 21:28 -0700
    Re: Hoe can i read.. Arno Welzel <usenet@arnowelzel.de> - 2020-07-21 06:59 +0200
    Re: Hoe can i read.. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-07-25 00:49 +0200
      Re: Hoe can i read.. "Mark-" <nospam@mapson.xyz> - 2020-07-26 14:42 +0000

#38559 — Hoe can i read..

FromRobert Baer <robertbaer@localnet.com>
Date2020-07-20 16:33 -0700
SubjectHoe can i read..
Message-ID<ERpRG.61532$lI.1755@fx22.iad>
   I have some stupid ideas to use javascrpt to (incrementally) read and 
parse an array.

   The bad thing is that file is OUTSIDE any javascript function and i 
see no way to do a generic? "capture"/read/access of data.

   Ideas?

Thanks

[toc] | [next] | [standalone]


#38560

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2020-07-21 02:04 +0200
Message-ID<XnsAC01150E21380eejj99@194.109.6.166>
In reply to#38559
Robert Baer <robertbaer@localnet.com> wrote on 21 Jul 2020 in 
comp.lang.javascript:

>    I have some stupid ideas to use javascrpt to (incrementally) read and 
> parse an array.
> 
>    The bad thing is that file is OUTSIDE any javascript function and i 
> see no way to do a generic? "capture"/read/access of data.
> 
>    Ideas?

There are no files 'INSIDE' a Javascript function.

The only way to access the content of a file is to access it.

============

Now, if the content is a piece of javascript, like:

const myArray = [1,2,3];

You can incorporate it like this:

<script src='myArrayFile.txt'></script>

=========

Otherwise you will have to read it with Javascript fetch()
or xmlhttp, or use serverside code to insert it.

=========

You could dump a text-string in a hidden <textarea> 
and access that with the DOM.






-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#38561

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2020-07-20 21:28 -0700
Message-ID<1021c441-4e76-48aa-9eef-c57fe587f313o@googlegroups.com>
In reply to#38559
On Monday, July 20, 2020 at 6:34:01 PM UTC-5, Robert Baer wrote:
> I have some stupid ideas to use javascrpt to (incrementally) read and 
> parse an array.
> 
>    The bad thing is that file is OUTSIDE any javascript function and i 
> see no way to do a generic? "capture"/read/access of data.
> 
>    Ideas?

Is this a JSON file?

[toc] | [prev] | [next] | [standalone]


#38562

FromArno Welzel <usenet@arnowelzel.de>
Date2020-07-21 06:59 +0200
Message-ID<hnnb1dFgrj7U1@mid.individual.net>
In reply to#38559
Robert Baer:

>    I have some stupid ideas to use javascrpt to (incrementally) read and 
> parse an array.
> 
>    The bad thing is that file is OUTSIDE any javascript function and i 
> see no way to do a generic? "capture"/read/access of data.

Define "outside".

Part of an HTML page? Then use the DOM.

Data which needs to be requested using HTTP? The use XHR.

External file? This may involve user interaction. For example see
<https://stackoverflow.com/questions/3582671/how-to-open-a-local-disk-file-with-javascript>



-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [next] | [standalone]


#38601

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2020-07-25 00:49 +0200
Message-ID<1902223.oMNUckLgyt@PointedEars.de>
In reply to#38559
Robert Baer wrote:

>    I have some stupid ideas to use javascrpt to (incrementally) read and
> parse an array.

There is no “javascript”, see my signature.
 
>    The bad thing is that file is OUTSIDE any javascript function and i
> see no way to do a generic? "capture"/read/access of data.
> 
>    Ideas?

Your description is too vague to give a recommendation.  What exactly is the 
problem that is to be solved?  Reading data from a source (which one?) or 
processing it?

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#38609

From"Mark-" <nospam@mapson.xyz>
Date2020-07-26 14:42 +0000
Message-ID<rfk4og$1pt8$1@gioia.aioe.org>
In reply to#38601
Thomas 'PointedEars' Lahn wrote:

> There is no “javascript”, see my signature.

Could the reply be classified as "priggish"?

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web