Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

IE Problem on modal

$
0
0

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. 


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>