When I am adding data to the server it send me a response saying data is added whereas in case of data already exist in server i receive a message saying this data with name and description exist in the server.... how can I show my server response text ?
edit: solved
$.ajax({
url: "/#",
type: "POST",
data: {
method:"a",
spogName:s,
spogDescription:spogDis
},
cache: false,
success:function(message) {
//alert($(".success").html());},
In this section i will have to get the response inside the jquery dialog
if (message === 'sucess result' ) {
$("#dialog-message")
.find('.error').hide().end()
.find('.success').show().end()
.dialog({
resizable:false,
height:180,
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
}
} else {
// server liked it, show the success placeholder and spawn the dialog
$("#dialog-message")
.find('.success').hide().end()
.find('.error').show()
.find('.message').text(message).end()
.end()
.dialog({
resizable:false,
height:180,
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
},
});