Sorry for my English. I am wondering whether it is possible to send one file to another file variable?
for example
oneFile.js
var a = true;
twoFile.js
if(a == true) {
alert("hellow");
}
Sorry for my English. I am wondering whether it is possible to send one file to another file variable?
for example
oneFile.js
var a = true;
twoFile.js
if(a == true) {
alert("hellow");
}
Well, if oneFile.js
is loaded before twoFile.js
, it will work. Though this exact scenario would be definitely bad practice.
By the way, jQuery works the exact same way, it defines $
in jquery.js
, and then you can use it in your own script files.
meskobalazs explained very well, If these two files are in different page I think you can use HTML5 session/local storage