I have this code:
<h:commandButton value="Login as Administrator" id="login"
data-loading-text="Loading..." class="btn btn-primary"
action="#{adminController.loginAdmin}"/>
<script>
$('#login').on('click', function() {
var $btn = $(this).button('loading')
// business logic...
$btn.button('reset')
})
</script>
I don't know why I can't call my javascript function. No change will show when i click the button, it execute only the action. I have take this script from bootstrap javascript, section button. http://getbootstrap.com/javascript/#buttons
Thanks for help.