I have a 2.js file in an html document, for example:
<script type="text/javascript" src="js/1.js"></script> <script type="text/javascript" src="js/2.js"></script>
This document also has an iframe. The iframe also has 2.js:
<script type="text/javascript" src="js/2.js"></script> <script type="text/javascript" src="js/3.js"></script>
So 2.js is in both docs. My plan was to put them together. I cannot put 3.js in both documents because it will ruin the material.
1.js got the variable. I want to use this variable in 3.js. But I canβt figure out how to pass a variable from 1.js to 3.js. Is it possible?
* Variable declared in 1.js.
source share