<SCRIPT language="JavaScript">
//initialise the value
var actual = new Array("", "");
var base = new Array("0","1");
var score = new Array("0","0");
function score_cal(index){
....
}
function xxxx(){}
function xyzzz(){}
</SCRPIT>
....
<BODY bgcolor="#cccccc" >
<FORM name="form1" >
.....
</FORM>
</BODY>
*****************************************
In my code, i declare "actual", "base", "score" as global variables. How can i convert it into a function, e.g
function initialize(){
var actual = new Array("", "");
var base = new Array("0","1");
var score = new Array("0","0");
}
so that the form can load it to initialize the variables before calling other functions??
thanks for kindly help
//initialise the value
var actual = new Array("", "");
var base = new Array("0","1");
var score = new Array("0","0");
function score_cal(index){
....
}
function xxxx(){}
function xyzzz(){}
</SCRPIT>
....
<BODY bgcolor="#cccccc" >
<FORM name="form1" >
.....
</FORM>
</BODY>
*****************************************
In my code, i declare "actual", "base", "score" as global variables. How can i convert it into a function, e.g
function initialize(){
var actual = new Array("", "");
var base = new Array("0","1");
var score = new Array("0","0");
}
so that the form can load it to initialize the variables before calling other functions??
thanks for kindly help