Show error message in popup using SharePoint function
We wanted to show some message in popup window of SharePoint style from javascript, something nicer than javascript alert. This function is core SharePoint function, so we don't need to create our custom using SP.UI.ModalDialog... it's very userful for showing alerts.
ShowErrorDialogCore('heading', 'message, can be html', function() {
console.log('callback');
//do your stuff
});
In case we don't want any callback, just call
ShowErrorDialogCore('heading', 'message', null);