Bootstrap modal: is not a function

后端 未结 13 2201
滥情空心
滥情空心 2020-12-02 17:45

I have a modal in my page. When I try to call it when the windows load, it prints an error to the console that says :

$(...).modal is not a function
         


        
13条回答
  •  清歌不尽
    2020-12-02 18:24

    Struggled to solve this one, checked the load order and if jQuery was included twice via bundling, but that didn't seem to be the cause.

    Finally fixed it by making the following change:

    (before):

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

    (after):

    window.$('#myModal').modal('hide');
    

    Found the answer here: https://github.com/ColorlibHQ/AdminLTE/issues/685

提交回复
热议问题