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
Post a Comment