Friday 30 May 2014

SCRIPT5007: Unable to get property 'showModalDialog' of undefined or null reference


You will get above error in SharePoint 2013 or SharePoint Online.
Solution:
Try below code
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
Instead of
SP.UI.ModalDialog.showModalDialog(options);