js-监听元素DOMNodeInserted和DOMNodeRemoved

监听document元素:

$(document)
        .on('DOMNodeInserted', '.item-content .ajax-progress', function() {}) // 插入(DOMNodeInserted)
        .on('DOMNodeRemoved', '#edit-field-qc-publisher-button + .ajax-progress', function() {}) //删除(DOMNodeRemoved)
};

ajaxComplete监听触发ajax事件:

#ajaxComplete
  $(document).ajaxComplete(function (e) {
    const { activeElement } = e.target;
    if (activeElement.id === 'edit-back') {
        console.log(activeElement.text());
    } else if (activeElement.id === 'edit-code') {
        ...
    }
  });

  # ajaxSuccess