weixin_33733810 2017-06-19 07:09 采纳率: 0%
浏览 28

结果数据的意义

I have this already written code by someone else to add new value on UI.Its using Java Script, AJAX and Json which I am totally new to.

I am not getting how they are fetching the variable resultData in done(function())

Code snippet is:

$.ajax(url, {
        cache : false,
        dataType: 'json',
        data : {
            depth: 10,
            readSystemFields: true,
            recordStates :'ACTIVE,PENDING'
        }
    }).done(function(resultData)

They are using it to get some values like:

$("#componentSectionFieldValue" +  {{rowidObject}} + (i + "" +j) + "b2bFinancial" ).append( $('<a />').attr('href', 'mailto:' + mdm.entity360view.helperUtil.getData(**resultData**, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].coValue,
 mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultValue,
 mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultKey, mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultKeyValue, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].coFieldValues, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].concatenateWith,  
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].getStrategy) ).text(mdm.entity360view.helperUtil.getData(resultData, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].coValue, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultValue, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultKey, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].defaultKeyValue, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].coFieldValues, 
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].concatenateWith,  
mdm.entity360view.ConfigContour.widgets.b2b.financal.section[i].field[j].getStrategy)) );
  • 写回答

1条回答 默认 最新

  • weixin_33694620 2017-06-19 07:20
    关注

    This is a very good resource to see how done works with jquery ajax.

    jqXHR.done(function( data, textStatus, jqXHR ) {}); An alternative construct to the success callback option, refer to deferred.done() for implementation details.

    Then go through the documentation on done().

    Since the jQuery.get method returns a jqXHR object, which is derived from a Deferred object, we can attach a success callback using the .done() method.

    $.get( "test.php" ).done(function() {
      alert( "$.get succeeded" );
    });
    

    Hope this helps to get you started.

    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题