Using jquery I'm opening a SharePoint page in a dialog, this works perfectly fine. Now on that page I have a button to submit a custom form and finally close the dialog again. While this works when looking in the console it throws two errors.
Is this something to worry about? And perhaps more importantly, how do I get rid of them?
Here's the code to open the dialog:
SP.UI.ModalDialog.showModalDialog(
{
url: _spPageContextInfo.siteAbsoluteUrl + "/SitePages/Checklist.aspx?Phase=" + newProjectPhase + "&Type=" + newProjectType + "&ProjectId=" + projectId,
title: "Checkliste ved skift af projektfase",
height: 250,
dialogReturnValueCallback: function(result){
if (result == SP.UI.DialogResult.OK) {
//alert("Closed succesfully");
originalSaveButtonClickHandler();
}
if (result == SP.UI.DialogResult.cancel) {
//alert("Cancelled...");
}
}
}
And the code to close the close the dialog again (Placed on new dialog page):
window.frameElement.commonModalDialogClose(1, 'Closed with OK result'); return false;
The first message is quite straight forward, somewhere 'now' cannot be referenced. The second one roughtly translates to "An object was expected".
Any ideas? The main problem right now, is the fact that IE sometimes opens a popup regarding the error - and Id rather not have my end users being bothers by that.