4
4
4sadly2020-05-01 23:22:23
JavaScript
4sadly, 2020-05-01 23:22:23

How to implement it?

I need to wait for a new window to open and launch another one, how can I do this, can I track the status of the new window? did like this:

for (let i = 0; i < phrases.length; i++) {
                        dialogs[i].classList.add('checked');
                        if(newW){
                            newW.onload = function(){var newW = window.open(location.href + '?sel=' + dialogs[i].dataset.listId);}
                        }else{
                            var newW = window.open(href + '?sel=' + dialogs[i].dataset.listId);
                        }
                        break;
                }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2020-05-01
@loonny

As far as I know, for usability and security reasons, window.open() can only be called from a direct user action

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question