Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close popup window

I have a popup window which is opened using this code:

function _openpageview(fieldid,objectid,opennew)
{
var url='/s_viewpagefield.jsp?fieldid='+fieldid+'&codedid='+objectid;

  web_window = window.open(url,'_blank', 'menubar=yes,location=no,scrollbars=yes,width=800,height=600,status=no,resizable=yes,top=0,left=0,dependent=yes,alwaysRaised=yes');
   web_window.opener = window;
   web_window.focus();


}

How can I close that popup from within the popup?

window.close();
self.close();
web_window.close();

all did not work

like image 371
Drew Avatar asked Jan 02 '13 16:01

Drew


People also ask

How do I close a pop-up window in Chrome?

Press ⇧ Shift + Esc on (Chrome on Windows or Mac).


1 Answers

An old tip...

var daddy = window.self;
daddy.opener = window.self;
daddy.close();
like image 85
molokoloco Avatar answered Oct 14 '22 16:10

molokoloco