In SP2010 you could easily show a dialog using a DOM node with something like this:
var test = "<div id='correspondence'>" + result + "</div>";
$('body').append(test);
SP.UI.ModalDialog.showModalDialog({
html: document.getElementById('correspondence'),
title: "Correspondence",
allowMaximize: false,
showClose: true,
autoSize: true
});
In SP 2013 I cannot for the life of me get this working. All that I get is an error stating: SyntaxError: missing ) after argument list
. Below is the code I tried. Any ideas on how to get this working?
SP.SOD.executeFunc('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', function()
{
var dlgOptions = { html:document.getElementById('correspondence'), autoSize: true, autoSizeStartWidth: 550 };
SP.UI.ModalDialog.showModalDialog(dlgOptions);
});