Hello everyone, I have called this in my button onclick event. This works well on chrome for authenticated users, (not for anonymous)
but in IE doesnt work, the error is
Unable to get property 'showModalDialog' of undefined or null reference
function addNewAdvertisementModal() {
var u = _spPageContextInfo.webServerRelativeUrl;
if (u.length > 0) { if (u[u.length - 1] != '/') u += '/'; }
var options = {
url: u + 'Lists/Advertisements/NewForm.aspx',
title: 'AddNewAdvert',
width: 640,
height: 800
}
SP.SOD.executeFunc("SP.UI.Dialog.js", null,SP.UI.ModalDialog.showModalDialog(options));
}
note: I also tried
ExecuteOrDelayUntilScriptLoaded(SP.UI.ModalDialog.showModalDialog(options), 'SP.UI.Dialog.js'); doesnt work.