javascript - window.open & close several times -


I have window.open (); I created a new window using and I want to close it. So I have made this code.

  $ ('# open'). ('Click', function () {var win = window.open ("", "", "width = 400, height = 200"); $ newwindows = $ (win.document.body); // more code $ NewWindow.find ('# close'). ('Click', function () {win.close (); // works just once}};});  
< P> And it works well in FF, works only once in Chrome (the stop button stops the work), and does not work on IE11 (just test v11) ...

What am I doing wrong? I.e., how to fix it to work cross browser?

The problem is from this line:

  $ newWindow.html (content);  

Adding you to a popup Otherwise, you are removing the original element and taking it to a new location.

  $ newWindow.html (content.clone ());  

Updated wired:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -