HOW TO ACCESS OTHER JS CODE?
I have to two //javascript files (coding language is in microscript).
How can I access a function from the other file.
Example:
FILE 1
//javascript
function test(){
console.log(func2());
}
test()
FILE2
//javascript
function func2(){
return "DAS IST EIN TEST";
}
global.func2=func2
test()
Neither working with global keyword or without
FILE 1
//javascript
function test(){
console.log( global.func2() );
}
test()
FILE2
//javascript
function func2(){
return "DAS IST EIN TEST";
}
global.func2=func2
test()
you add all the functions you want to be seen in the MicroScript code and other JavaScript scripts to
global.name_function = name_function
You refer in MicroScript directly and in JavaScript code via
// microscript
name_function()
// javascript
global.name_function()