Note that we can get rid of the variable personsName and make the string on the fly. Save any variable that want to be shared as one object. In short, I need that a .js file read a global variable in another js file where this variable is fed into a function called by an event of a user. In some cases, you need to use a variable and it must be accessed by one or more functions, at that time you can declare the variable in the global scope itself so that all the functions can access it. Then pal how can I do that? Yep, the same old temporary storage area, but local storage is persistent Whatever is set in the local storage will stay until manually deleted; Yep, we can still retrieve data from the local storage even after the window is closed and reopened later. When we create a new var newwin = window.open(), we can directly insert the variables into the new window. If you continue to use this site we will assume that you are happy with it. But it gave me an output as at the below. FULL TUTORIAL. I am writing a basic Polymer Component that should be able also to change its style at the change of a property, I'm been learning how to use JavaScript 'node-style' streams using Baconjs, AJAX navigation request is not working in windows phone universal devicePlease find me anybody solution, how to pass variables between 2 php files, typescript: tsc is not recognized as an internal or external command, operable program or batch file, In Chrome 55, prevent showing Download button for HTML 5 video, RxJS5 - error - TypeError: You provided an invalid object where a stream was expected. These variables are JavaScript variables. Then in the header I link in the stylesheet style.css (have set the server to parse css-documents for php, which it does successfully). How do I share data between two JavaScript files? //from the iframe var theVariable = window.parent.yourVaraibleName; //from the parent var theVariable = document.getElementById ("iframeId").contentWindow . Writing into an alert box, using window.alert() . Yep, no need for any gimmicks. js and using top. There may be numerous callbacks inside a simple function so that the data can be shared between the functions. How To Pass Variables Between Pages In Javascript (click to enlarge). How do you pass variables between files in Python? HOW TO PASS VARIABLES BETWEEN PAGES IN JAVASCRIPT. Writing into an alert box, using window.alert (). Passing variables between two open .mdb files Passing PHP variables between scripts.