1

My problem is like this: ESC-problem

But the difference is that, I do not have access to content of child window( I cant put script in that).

Is that possible that I handle esc keydown in parent window for child window.

Community
  • 1
  • 1
Masoud Nazari
  • 476
  • 2
  • 6
  • 17

2 Answers2

5

This is all you need.

var myWindow = window.open();

myWindow.onkeydown = function(e){
    if(e.keyCode === 27){
        alert('esc key pressed');
    }
};
Sablefoste
  • 4,032
  • 3
  • 37
  • 58
gkiely
  • 2,987
  • 1
  • 23
  • 37
0

You can't, but you can use ajax to load specified content into a simulated window (a div or something styled like a window, that should not be hard to do), in your own page, where you can do anything you want.

This is also (in most cases anyway) a better way to load content than pop-ups.

zozo
  • 8,230
  • 19
  • 79
  • 134