setTimeout(MyDeleteInstance, 500);......function MyDeleteInstance(){ if (myParent.deleteInstance(index)) {alert("Deleted");} else {alert("Failed");}}