I wanted to call a function defined in a first.js file in second.js file. both files are defined in an HTML file like:
I want to call fn1() defined in first.js in second.js. From my searches answers were if first.js is defined first it is possible but from my tests I haven't found any way to do that. Thanks
Edit: Here's sample codes: second.js
this.getSecEnabled = function(){ ----> i dont know how this is used here..
return SecEnabled;
}
first.js
if( getSecEnabled() == "SecEnabled" ){
alert(" Security Enabled....!!");
}else{
alert(" Secuity Disbaled.!!");
}
Issue : not able to print any of the statements here Enabled/Disabled.
Please help i am new to javascript