Reputation: 1
I want to pass an error message. How do I do it and what do I need to change?
success: function(data) {
var div = $('<div>').attr('id', 'message').html(data.message);
if (data.success == 0) {
$.modaldialog.error('The operation failed.');
...
I want to replace the div
with the error message that comes into this success function. I still need the id though I think because it is what toggles between the success and error block.
'The operation failed.' should be replaced with the error message that is contained in 'data.message'.
Upvotes: 0
Views: 200
Reputation: 4146
"'The operation failed.' should be replaced with the error message that is contained in 'data.message'"
success: function(data){
var div = $('<div>').attr('id', 'message').html(data.message);
if(data.success == 0){
$.modaldialog.error(data.message);
Upvotes: 1