How do I close a modal window after AJAX success

前端 未结 6 1037
梦如初夏
梦如初夏 2020-12-17 14:19

I have a button which opens a modal but I have prevented the modal close by clicking background or ESC key.

My button looks like this:

6条回答
  •  青春惊慌失措
    2020-12-17 15:05

    To close bootstrap modal you can pass 'hide' as option to modal method as follows.

    $('#CompanyProfile').modal('hide');
    

    Use this code inside ajax success.

    Fiddle Demo

提交回复
热议问题