TypeError: $(…).popover(…).data(…) is undefined

你离开我真会死。 提交于 2019-12-12 01:19:44

问题


I've two popover, one to show the login form and other to show after the user has logged in. I want a big popover with login form and a small one after login. So I'm adding a class when the popover is initialized. But it is giving an error and preventing all other ajax functions in the page not to work.

I'm using the latest bootstrap, and jquery. I'm using bootstrap 3.3.4 version.

Here is my code, please have a look.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>


$('[data-popover-content="#logoutPopover"]').popover({
        placement: 'bottom', 
        container: 'body',
         html: true,
         content: function () {
           var clone = $($(this).data('popover-content')).clone(true).removeClass('hide');
           return clone;
        } 
     })
    .data('show.bs.popover')
    .tip()
    .addClass('user-profile-popover-dropdown');

来源:https://stackoverflow.com/questions/38495436/typeerror-popover-data-is-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!