I am trying to pass a variable from a.js file to b.js file.
a.js
var test='test string';
b.js
alert(test);
I am sure a.js is included in my html before b.js but I still got ‘test‘ is not defined error. Are there anyway to debug this? Thanks a lot!
To make sure test is assigned to the global scope, do: