I am trying to add a button to a page showing a community site discussion that launches a modal dialog showing the page with the discussion and all replies but when I click the button the modal dialog says there was an error and there is the message: Resource interpreted as Document but transferred with MIME type image/gif: "https://site.sharepoint.com/_layouts/15/images/blank.gif". in the console log. I have used the function to launch a modal dialog many times and it has always worked. When I test it on a typical Discussion Board list it works as well. Any thoughts on why a Community Discussion list would be different? Here is the code I am using for the modal dialog. In this case pageUrl = /sites/SharePointInitiativeSandbox/SitePages/Topic.aspx?RootFolder=/sites/SharePointInitiativeSandbox/Lists/Community%20Discussion/Test If I type this url into the browser window it works so I don't this it is the issue.
function dialogfunction(pageUrl) {
var options = { url: pageUrl, width: 800, height: 600, dialogReturnValueCallback: onCloseCallback };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
function onCloseCallback(dialogResult, returnValue){
SP.UI.Notify.addNotification('Something has changed');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}