Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loading data from a JavaScript file

captfossSep 7 2009 — edited Sep 8 2009
I am writing a Java application that will run client-side, and will essentially allow the user to download, update, and then reupload a JavaScript file. The data I'm needing to parse / build to the JS file consists of staticlly-defined string arrays, and one associative array.

The file looks like this.
var array1 = new Array();
array1[0] = "String1";
array1[1] = "String 2";
array1[2] = "String 3";
I'm wondering if there is a more simple/eleoquent way of loading arrays from a JavaScript file than simply reading them and writing parse code by hand to extract the data I want... I can write the parsing code without any problem, but, I'm wondering if there's something built-in that I just don't know about...

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 6 2009
Added on Sep 7 2009
5 comments
545 views