Skip to content Skip to sidebar Skip to footer

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;

Solution 1:

An old tip...

var daddy = window.self;
daddy.opener = window.self;
daddy.close();

Solution 2:

You can only close a window using javascript that was opened using javascript, i.e. when the window was opened using :

window.open

then

window.close

will work. Or else not.

Solution 3:

For such a seemingly simple thing this can be a royal pain in the butt! I found a solution that works beautifully (class="video-close" is obviously particular to this button and optional)

 <a href="javascript:window.open('','_self').close();"class="video-close">Closethiswindow</a>

Solution 4:

Your web_window variable must have gone out of scope when you tried to close the window. Add this line into your _openpageview function to test:

setTimeout(function(){web_window.close();},1000);

Solution 5:

in my case (joomla opened popup) I had to use this:

onclick="submit(); window.parent.location.reload(false);window.parent.SqueezeBox.close();"

Hope this may help

Post a Comment for "Close Popup Window"