I am studying Marionette.js and would like to know the right way to get the ui element to be manipulated with jQuery. In my LoginItemView, I declare ui elements and a function to display an invalid login error message:
ui: {
username: "#username",
password: "#password",
btnLogin: "#btnDoLogin",
messageContainer: "#messageContainer"
},
displayMessage: function() {
$(this.ui.messageContainer.selector).show();
},
I also tried:
$(this.ui.messageContainer[0]).show();
but the message is never displayed.
And here is the templateMessage code in the template.
<div class="alert alert-danger alert-dismissable login-message-display" id="#messageContainer" style="display: none;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>Error!</strong> Username and/or password incorrect!
</div>
source
share