How to call a function from one js file to another js file in electron?


#1

I have two .js file. e.g : one.js and two.js. Now i have a function in one.js which i want to call from two.js. But i am unable to make it. How to do this? Can anyone please help me?
Here is the code:
one.js:
function myStringPath(pathString)
{

              var newString =String(pathString);
              return newString;

            }

two.js:

var newPathString =myStringPath();


#2

If both one.js and two.js are in render process you can call it without any issue
in your html file add both these scripts
script type=“text/javascript” src=“resources/scripts/one.js”>
script type=“text/javascript” src=“resources/scripts/two.js”>


#3

thankx a lot :smiley: