tim042849
05-03-2006, 07:00 PM
I'm using a function in the onload handler:
onload="InitForm();"
InitForm needs to call other functions if the javascript files containing
them have already been sourced.
I've used the following method - borrowed from "C" header files:
Each javascript file has a global variable that "announces" the
loading of the files.
Example: for GeoData.js
var GeoData_js = 1;
And in the Initform function I place the following:
var type = typeof(GeoData_js);
if(type.toUpperCase() != 'UNDEFINED'){
InitLists(); // call the function in GeoData.js
}
Initial tests indicate that this should work.
However, I have a minimal knowledge of javascript, so I welcome comments on a better or more compact way to do this.
Thanks
Tim
onload="InitForm();"
InitForm needs to call other functions if the javascript files containing
them have already been sourced.
I've used the following method - borrowed from "C" header files:
Each javascript file has a global variable that "announces" the
loading of the files.
Example: for GeoData.js
var GeoData_js = 1;
And in the Initform function I place the following:
var type = typeof(GeoData_js);
if(type.toUpperCase() != 'UNDEFINED'){
InitLists(); // call the function in GeoData.js
}
Initial tests indicate that this should work.
However, I have a minimal knowledge of javascript, so I welcome comments on a better or more compact way to do this.
Thanks
Tim