twitter/bootstrap — Issue #1177: 2.0-wip: Adding and removing alerts dynamically from JS
Author: tibbe
Created: 2012-01-25 04:23:55+00:00
State: open

I spent quite some time trying to find the right patterns for adding alert messages dynamically e.g. when an AJAX request fails. It's not quite clear how to do this well. Since the `.close` action removes the alert from the DOM it seems to me that the right approach would be to inject some HTML dynamically (i.e. the DIV element and its children) when the error occurs and then call `.alert`. It would be nice if the documentation was more clear on how to use alerts in this typical scenario.