Sharepoint - Object # has no method 'showModalDialog' in chrome
Consider the following code:
Replace the line:
StackOverFlow
I have this code for a button click and the modal opens fine in firefox and ie. But it doesn't open in Chrome. It gives the following error in console:function ShowWelcomeDialog() { var data = {}; var options = { url: "/_layouts/xxxx/xxxxxss.aspx", title: "xxx xxx", width: 700, height: 950, dialogReturnValueCallback: myDialogCallback, args: JSON.stringify(data) }; SP.UI.ModalDialog.showModalDialog(options); return false; }
Uncaught TypeError:Object # has no method 'showModalDialog'..Solution:
Replace the line:
withSP.UI.ModalDialog.showModalDialog(options);
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
StackOverFlow
Comments
Post a Comment