How to properly transfer data between two scenarios.
In this particular case, I have an element in one script, but I want to add it to another script.
The easiest way to do this is to use the global window object as an intermediate.
But globals are not the best practice.
What is the correct way to pass this element to another script?
Both scripts are encapsulated in a module template.
Script 0 Create an item point
var element = document.createElement( "div" );
element.innerHTML = response_text;
Script 1 Add an item point
Vi.sta = {
};
Both are enclosed in a module template.
(function(){
})()
user656925
source
share