Dynamically create Bootstrap alerts box through JavaScript

前端 未结 10 907
有刺的猬
有刺的猬 2020-12-13 12:20

I\'m using Bootstrap 2.0 for my project and I would like to dynamically add Bootstrap alert box in my page (http://twitter.github.com/bootstrap/javascript.html#alerts). I wa

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 12:41

    I found that AlertifyJS is a better alternative and have a Bootstrap theme.

    alertify.alert('Alert Title', 'Alert Message!', function(){ alertify.success('Ok'); });
    

    Also have a 4 components: Alert, Confirm, Prompt and Notifier.

    Exmaple: JSFiddle

提交回复
热议问题