Re: best way to load arrays with large amounts of data?
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Sat, 27 Oct 2007 13:12:23 +0200
Marshal Anderson wrote:
I'm working on an application that requires a lot of internal data -
short texts, numbers, switches etc. At the moment the only way I have of
loading these is long lines of Array[1,2,3 etc]=The Data.
No, certainly you don't. However, you may have something like
var a = new Array();
a[0] = ...;
a[1] = ...;
In the VB version I read data in from text files - is there a similar
feature in JavaScript -
Reading files or rather accessing resources is not a feature of the
language, but a feature of an API that can be used by the language.
As for reading text files/resources, you can load the file per URI in an
iframe and read its contents using the DOM, or you can use the
IXMLHTTPRequest interface to make a request and retrieve the response text.
http://en.wikipedia.org/wiki/Document_Object_Model
http://en.wikipedia.org/wiki/AJAX
or at least soem thing mroe flaxible than lines and lines of assignments?
var a1 = new Array(
...,
...
);
Since JavaScript 1.3:
var a2 = [
...,
...
];
PointedEars
.
- References:
- best way to load arrays with large amounts of data?
- From: Marshal Anderson
- best way to load arrays with large amounts of data?
- Prev by Date: best way to load arrays with large amounts of data?
- Next by Date: Re: F1 key to go to a link
- Previous by thread: best way to load arrays with large amounts of data?
- Next by thread: Re: best way to load arrays with large amounts of data?
- Index(es):
Relevant Pages
|