showModalDialog
showModalDialog copied to clipboard
Unable to close the popup on close button
when we add a cancel button no code is working to close the popup. please provide any solution on this.
Assuming you were trying to do something like,
Response.Write("<script language='javascript'>window.close();</script>");
don't use ~~window.close();
~~ and instead use
parent.document.getElementsByTagName('dialog')[0].close();
as stated at the bottom of the README
parent.document.getElementsByTagName('dialog')[0].close(); does not work for me.... I get: Cannot read properties of undefined (reading 'close')