Files
FreeJ/scripts/javascript/examples/json_test.js
Jaromil 4948563a84 experimenting on engine reset()
plus some cleanup and indestructible flag for controllers
2009-05-20 15:51:45 +02:00

23 lines
403 B
JavaScript

include("../lib/json2.js");
echo("JSON library included");
files = scandir(".");
echo("files found: " + files.length);
// stringify the array
json_enc = JSON.stringify(files);
echo("json size: " + json_enc.length );
// and parse it back
json_dec = JSON.parse(json_enc);
// then go through the array and load the scripts we like
var c;
for(c=0; c<json_dec.length; c++) {
echo(json_dec[c]);
}