开发者

How to pass a value in jQuery

开发者 https://www.devze.com 2023-02-12 13:54 出处:网络
I want to pass an error message. How do I do it 开发者_StackOverflow中文版and what do I need to change?

I want to pass an error message. How do I do it 开发者_StackOverflow中文版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'.


"'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);


if(data.success == 0){
          $.modaldialog.error(div);

??

0

精彩评论

暂无评论...
验证码 换一张
取 消