I have the following lines of code in my webpage - example/demo.
HTML:
<p data-toggle="modal" data-target="#messagesModal"><a target='_blank' href="#">Messages <span class="badge">2</span></a>
</p>
<!-- Modal -->
<div class="modal fade" id="messagesModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Messages</h4>
</div>
<div class="modal-body">
<div class="alert fade in">
<a target='_blank' href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Message 01</strong>:
<p>Lipsum Ipsum
</p>
</div>
<div class="alert fade in">
<a target='_blank' href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Message 02</strong>:
<p>Ipsum Lipsum</p>
</div>
</div>
<div class="modal-footer">
<div class="col-md-8 pull-left">
</div>
<div class="col-md-4">
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
How can I update the badge to represent the correct amount of messages in the modal?
For example, when the user closes or removes a message in the modal, the badge will go from displaying the number 2
to 1
?
Also, is it possible to display the text "There are no more messages." when all of the messages have been removed?
I have a table in html with only 1 column: My FILES. What I'm trying to reach: (a file explorer of a folder in the server) When the page loads in body onload i call an ajax function that add a row ...
I have a table in html with only 1 column: My FILES. What I'm trying to reach: (a file explorer of a folder in the server) When the page loads in body onload i call an ajax function that add a row ...
I'm trying to incorporate a React component for radio buttons in my iOS app that's written in React Native, however I get an error when trying to import the component using the method that the author ...
I'm trying to incorporate a React component for radio buttons in my iOS app that's written in React Native, however I get an error when trying to import the component using the method that the author ...
I am trying to implement angular-translate in my application. So, I found the following JSFiddle which should demonstrate angular-translate, but I get the following error message: 'undefined' is ...
I am trying to implement angular-translate in my application. So, I found the following JSFiddle which should demonstrate angular-translate, but I get the following error message: 'undefined' is ...
On my server (written in Go), I'm sending back a custom header field that I'm trying to read from when I make an ajax call. $.ajax({ url: url, success: function(data, status, request)...
On my server (written in Go), I'm sending back a custom header field that I'm trying to read from when I make an ajax call. $.ajax({ url: url, success: function(data, status, request)...