I am new to javascript and facing this problem of window.open not loading the new window content untill the parent window execution is complete in chrome.
for example :-
function abc(){
few line of code...
const win1=window.open(url, ,)
next line of code...
}
in the above window.open url is not being loaded and the execution goes to next line of code. once the whole parent flow is complete then only the window.open URL is being loaded.
My problem is i want window.open URL to get loaded and then return some values from it for processing of next line of code.
Is it possible to achieve. can someone please help.
2
Answers
you can’t known when the other page loaded direct, but if these pages are Same-Origin,you can store a status when the other page loaded to localStorage,and check the status from localStorage in a ‘for loop’ at the first page
You likely want to give the browser a breather.
Here is an example of how, based on the VERY rudimentary example you gave