I am trying to open a modal pop up using the following JavaScript:
if (this.Context != null && !this.Context.Items.Contains(SPRequestModule.AllowFramingFlag)) {
this.Context.Items.Add(SPRequestModule.AllowFramingFlag, "1");
}
var options = { url: "https://eeeee/Lists/ProjectLibrary/NewForm.aspx", width: 400, height: 300 };
//enter code here
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);`
I also added the site to the trusted sites zone. I get the following error
the content cannot be displayed in a frame sharepoint.
I also tried to open a iframe using
window.top.location.href = "https://eeeee/Lists/ProjectLibrary/NewForm.aspx"
Still get the same result..