Because of some kind of language problems, I have to get the same name variable from two JS files like this.
JS1.js
SameName = new Object();
SameName = {}
JS2.js
SameName = new Object();
SameName = {}
How could I do this?
Because of some kind of language problems, I have to get the same name variable from two JS files like this.
JS1.js
SameName = new Object();
SameName = {}
JS2.js
SameName = new Object();
SameName = {}
How could I do this?
I suggest going through these two links. Namespacing seems like a good alternative.
if it is possible, copy every object property from the first file to another object (not just assign, but copy) before you load second file
if it is not possible, you will get only the object which source file appears later in the document