Bootstrap modal 'loaded' event on remote fragment

前端 未结 5 780
醉酒成梦
醉酒成梦 2021-02-07 04:26

I\'m currently using Twitter Bootstrap modal component and i have an issue where I use jquery validation plugin on input fields in the content I load remotely using the data-rem

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 04:54

    According to both these issues:

    https://github.com/twbs/bootstrap/issues/5169

    https://github.com/twbs/bootstrap/pull/6846

    ..as of now the Bootstrap developers are digging their heels in and refusing to add a loaded event into Bootstrap.

    So instead they recommend you avoid using the data-remote markup and load the data yourself into the modal:

    $('#myModal').modal(your_options).find('.modal-body').load('request_url', function () {
      // do cool stuff here all day… no need to change bootstrap
    }')
    

提交回复
热议问题