const buttonOriginalHtml = button.html(); button.on('click', function (e) { const pushedButton = $(this); const asyncAction = pushedButton.data('async-action'); const url = pushedButton.attr('href'); const redirectUrl = pushedButton.data('redirect-path') ? pushedButton.data('redirect-path') : ''; function wait(sec) { const objDef = new $.Deferred(); setTimeout(function () { objDef.resolve(sec); }, sec * 1000); return objDef.promise(); } ・・・以下略・・・