在对话框关闭时执行操作

SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js");

function showDialog(){
    var options = SP.UI.$create_DialogOptions();
    options.url = "/mySite/lists/myList/NewForm.aspx";
    options.dialogReturnValueCallback = myCallBackFunction;
    SP.UI.ModalDialog.showModalDialog(options);    
    function myCallBackFunction(result,data){
        switch(result){
            case SP.UI.DialogResult.invalid: 
                alert("The dialog result was invalid"); 
                break;
            case SP.UI.DialogResult.cancel: 
                alert("You clicked cancel or close"); 
                break;
            case SP.UI.DialogResult.OK: 
                alert("You clicked OK, creating an item in the list."); 
                break;
        }
    }
}