Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript error when destroying Bootstrap popover

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

like image 436
ElPiter Avatar asked Aug 26 '12 12:08

ElPiter


1 Answers

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.

like image 171
ElPiter Avatar answered Sep 24 '22 06:09

ElPiter