Javascript error when destroying Bootstrap popover

Trying to change the header and contents of the Popover boot buffer on the fly, I am having some problems.

I get this problem when destroying popover content in selector.

Error in this

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

Part of the code is this:

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

I get an error on this line. I checked that $("#test_name-" + json.test_id) really contains a Popover.

Edited: I solved this thanks to the comments. I have not used the latest versions of Bootstrap. After upgrading to version 2.1.0, everything works perfectly.

Attention! In this new version, you need to set the trigger to โ€œhangโ€, since it defaults to โ€œclickโ€.

thanks a lot

Pedro

+6
source share
1 answer

I solved this thanks to the comments. I have not used the latest versions of Bootstrap. After upgrading to version 2.1.0, everything works perfectly.

+1
source

Source: https://habr.com/ru/post/923783/


All Articles