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


Groups > comp.lang.javascript > #38560

Re: Hoe can i read..

Newsgroups comp.lang.javascript
Subject Re: Hoe can i read..
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <ERpRG.61532$lI.1755@fx22.iad>
Date 2020-07-21 02:04 +0200
Message-ID <XnsAC01150E21380eejj99@194.109.6.166> (permalink)

Show all headers | View raw


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)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web