Javascript error when destroying Bootstrap popover

回眸只為那壹抹淺笑 提交于 2019-12-10 13:36:16

问题


Trying to change on the go the title and content of a bootstrap Popover, I am having some trouble.

I am getting this issue when destroying a popover content in a selector.

The error is this

TypeError: 'undefined' is not a function (evaluating 'data[option]()')

The piece of code is this:

$("#test_name-" + json.test_id).popover('destroy');

I get the error in that line. I have checked that $("#test_name-" + json.test_id) really contains a Popover.

Edited: I solved it thanks to the comments. I wasn't using the latest versions of Bootstrap. Once upgraded to 2.1.0, all seems to work perfect.

Important! In this new version, you need to set trigger to "hover" as it is by default to "click".

Thanks a lot

Pedro


回答1:


I solved it thanks to the comments. I wasn't using the latest versions of Bootstrap. Once upgraded to 2.1.0, all seems to work perfect.



来源:https://stackoverflow.com/questions/12130265/javascript-error-when-destroying-bootstrap-popover

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