R
R
romasovest2017-08-21 16:52:01
JavaScript
romasovest, 2017-08-21 16:52:01

Why doesn't onload() work on vk.com?

Through the console, being on the vk.com domain, I create a window:

var mdk_win = window.open('mudakoff', 'mdk_win', 'width=600,height=400');
mdk_win.onload = function(){
  alert('окно MDK загружено');
};
but for some reason onload() doesn't work. Prompt in what the reason, and how all the same to receive this event. Can it be replaced with something, for example, checking the existence of some element in the interval?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2017-08-21
@romasovest

This is how it works:

var mdk_win = window.open('https://vk.com/mudakoff', 'mdk_win', 'width=600,height=400');
mdk_win.addEventListener('load', function(){
  console.log('окно MDK загружено');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question