Hi,
I have an interesting problem. I have created an html based interface that
links to an external .js file with only functions in it. The functions set
an arrays values depending on which function is called by the interface....
The external .js file looks like this below:
function myFunction1(){
arryEntry[0] = "some value1";
arryEntry[1] = "some value2";
arryEntry[2] = "some value3";
arryEntry[3] = "some value4";
}
function myFunction2(){
arryEntry[0] = "other value1";
arryEntry[1] = "other value2";
arryEntry[2] = "other value3";
arryEntry[3] = "other value4";
}
etc...
In the html interface I am calling the function(s) depending on a list
selection. This functions one arg (functionNumber) depends on a list
selection.
function getArryEntries(functionNumber){
eval("myFunction"+parseInt(functionNumber)+"()");
var value0 = arryEntry[0];
var value1 = arryEntry[1];
var value2 = arryEntry[2];
var value3 = arryEntry[3];
}
This all works well so far and the array entries are changed successfully
depending on the getArryEntries(functionNumber) selection.
However, at some time in the session I am adding (actually writing)
additional functions to the external .js file. Appending to the file. The
problem is that the interface will not pick up the newly written functions
on runtime. If the interface is closed and opened again, then it can see the
new functions.
I thought of initiating an array of the existing functions when the
interface loads and append to the array when the new functions are created.
It would then write to the file, but use the array at runtime. No success so
far.
What would be recommended here?
Thanks
David