I have a site that opens a modal dialog within it when the site refreshes.
To close the modal dialogue via JavaScript I wrote
window.frameElement.commonModalDialogClose();
which works perfectly fine in Google Chrome, but nothing changes when I use Internet Explorer. The modal dialog still appears.
I've tried several other approaches, such as
window.frameElement.commitPopup('Closed with OK result');
window.frameElement.cancelPopUp();
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK,"Test");
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancelled clicked');
but none of them seemed to work either.
I don't know what the issue is. Does someone know a solution to this?