Accessing Popover Data with Bootstrap 3

How I solved this issue with access popover data with Bootstrap 3

I was banging my head against this today so I figured I would share to hopefully reduce someone’s banging their head time by a few minutes.

One of the things Bootstrap has done as part of their upgrade is to namespace their stuff, this is a good thing but is a bit of an arse if you weren’t expecting something to be renamed.

Case in point, this used to work in Bootstrap 2.x

$('#my_awesome_element').data('popover');

And this would return the popover element that is going to be created, as of Bootstrap 3 you have to write something like;

$('#my_awesome_element').data('bs.popover');

A simple change but one that (at the time of writing) wasn’t documented anywhere that I could see.


Recent posts View all

Web Dev

Updating payment method email addresses in Stripe

You can't update the email address associated with a payment method in Stripe via their dashboard, you need to use the Stripe CLI

Ruby

Irreversible Rails Migrations

What are irreversible migrations and how might we use them to our advantage?