触发Bootstrap JS行为以动态加载HTML内容 [英] Trigger Bootstrap JS behavior for dynamically loaded HTML content
问题描述
我正在动态加载包含Bootstrap标记的HTML模板.但是,没有任何Bootstrap Javascript行为被应用于加载的内容.例如,如果加载的内容包含Bootstrap模态的标记,则该模态不能正常运行.
I am dynamically loading HTML templates containing Bootstrap markup. However, none of the Bootstrap Javascript behavior is being applied to the loaded content. For example, if the loaded content contained markup for the Bootstrap modal the modal doesn't behave correctly.
有没有一种方法可以触发Bootstrap刷新或自动应用Java脚本到新加载的内容?
Is there a way I can trigger Bootstrap to refresh or apply it's Javascript to the newly loaded content?
推荐答案
值得一试:
http://nakupanda.github.io/bootstrap3-dialog/#加载远程页面
查看更多讨论:
https://github.com/nakupanda/bootstrap3-dialog/issues/217
https://github.com/nakupanda/bootstrap3-dialog/issues/189
https://github.com/nakupanda/bootstrap3-dialog/issues/185
https://github.com/nakupanda/bootstrap3-dialog/issues/119
https://github.com/nakupanda/bootstrap3-dialog/issues/44
这篇关于触发Bootstrap JS行为以动态加载HTML内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!