Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'loading'
It's caused by jquery-ui and bootstrap-button plugins conflict. In fact jquery-ui code js code should go before bootstrap.js, and that solves the problem.
Just put jquery-ui plugins before bootstrap.js
Another solution is to add this line after bootstrap:
$.fn.btnBootstrap = $.fn.button.noConflict();
and then when calling the loading and reset:
$btn.btnBootstrap('loading');
$btn.btnBootstrap('reset');