Javascript/JQuery populate array many elements -
okay, i'm using tampermonkey/greasemonkey load , save data userscripts using gm_getvalue/setvalue
at 1 point, had stored 7000 objects 1 of these arrays, , proceeded output via window.open
, $(disp.document.body).text
, subsequent .join
call on array. allowed me copy 7000 objects strings normal .txt file in notepad.
however, issue comes this: cleared original array of 7000 objects, want restore of these array; without having either manually array[0] = "foo"
, array [1] = "bar"
etc.
i thinking maybe open new window, dump 7000 strings it, , somehow have button parse window? not sure how
i'm wondering what's efficient/easiest way manually populate array outside source (notepad) javascript arrays.
hopefully makes sense
have tried using string.protype.split()?
arr = textfromfile.split(/\n|\r/);
Comments
Post a Comment