Twitter Bootstrap Alert Overlay
This is a small javascript snippet to show Bootstrap Alert Elements as result of XMLHttpRequests.
Integrations
Download the code from GitHub and copy the dist directory to your project.
Include the following lines of code in the <head>
section of your HTML.
<link href="path/to/twbs-alert-overlay.jquery.min.css" rel="stylesheet" /> <script src="path/to/twbs-alert-overlay.jquery.min.js"></script>
The basics
Use the predefined bootstrap alert-*
types and add some content to show as alert message:
success
,info
,warning
ordanger
$.twbsAlertOverlay({ messages: [ {type: 'success', content: 'The entity was successfully updated.'}, {type: 'warning', content: '<p>The database connection is not working!</p>'} ] })
Contributing
Building
java -jar closure-compiler.jar --js src/js/jquery.twbs-alert-overlay.js --js src/js/core.js --js_output_file dist/twbs-alert-overlay.jquery.min.js
Use an online css compressor, for instance CSS Compressor