I have 2 html and 3 js files in this manner
globals.js -->
testIndex = 1;
login.html
//includes global.js and login.js. Fires event() function on a button click
login.js
function event()
{
window.testIndex = 2;
window.location.assign('index.html')
}
index.html
//includes globals.js and index.js
fires init() function onLoad
index.js
function init()
{
alert(window.testIndex);
}
The assigning works fine, but the alert box in index.html always reads 1. My global variables are getting reinitialized when i use window.location.assign. I need to pass some variables (some of them are not plain text strings so cant use the url). What should i do ?