At some point of a Javascript, I need to redirect to another page. I do it like this.
window.location.href='http://localhost:3000/m/debug';
And then, when that page finishes loaded, I need to access the window.Ext object of this new page. I have try to do the following, but it does not work.
window.onload = function(){alert(typeof window.Ext);}; // returns 'undefined'
window.location.href='http://localhost:3000/m/debug#settings';
Or
setTimeout(function(){ alert(typeof window.Ext); },5000); // is never called
window.location.href='http://localhost:3000/m/debug#settings';
Any idea ?
Once you set
window.location.hrefthe browser navigates away from the current page – no further JavaScript will be executed … not even functions set usingsetTimeout/setIntervalIf you want to execute JavaScript on the target page you need to add update the target page with your JavaScript !