1

On the screenshot below I have circled a 'home' image button on the modal dialog page. I would somehow like to add a close window function to this to close the modal dialog.

I have tried the below code however this does not appear to work within the modal.

Any ideas?

<img src="image.jpg" width="120" height="24" onclick="window.close();">

Modal Close Windows

1
  • <img src="image.jpg" width="120" height="24" onclick="SP.UI.ModalDialog.commonModalDialogClose();"/> try this. Assuming this is a SharePoint modal popup Oct 12, 2016 at 14:34

1 Answer 1

1
<img src="image.jpg" width="120" height="24" onclick="SP.UI.ModalDialog.commonModalDialogClose();"/>

OR

<img src="image.jpg" width="120" height="24" onclick="window.frameElement.commitPopup();">

SP Dialog framework extends the window.frameElement object, So you can use either of this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.