销毁Bootstrap popover时出现Javascript错误 [英] Javascript error when destroying Bootstrap popover

查看:84
本文介绍了销毁Bootstrap popover时出现Javascript错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试随时更改引导程序Popover的标题和内容,我遇到了一些麻烦。

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

我在破坏popover内容时遇到此问题选择器。

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

错误是这个

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

这段代码是这个:

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

我收到该行的错误。我检查过 $(#test_name-+ json.test_id)确实包含一个Popover。

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

已编辑:由于评论我解决了。我没有使用最新版本的Bootstrap。一旦升级到2.1.0,一切似乎都很完美。

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".

非常感谢

Pedro

推荐答案

由于评论,我解决了这个问题。我没有使用最新版本的Bootstrap。一旦升级到2.1.0,一切似乎都很完美。

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.

这篇关于销毁Bootstrap popover时出现Javascript错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆