Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Created December 21, 2011 20:06
Show Gist options
  • Save thiagopnts/1507486 to your computer and use it in GitHub Desktop.
Save thiagopnts/1507486 to your computer and use it in GitHub Desktop.
Popover with ajax
//Selecionando o select pelo ID e configurando o popover.
$("#select").popover({html: "true", trigger: "manual", position: 10, placement: "right"});
$("#select").mouseover(function() {
var self = $(this);
var html = '';
$.get(
'/path/to/get', function(data) {
for(var i = 0; i < data.length; i++) {
html+='<li>'+data[i].info+'</li>';
}
self.attr('data-content', html);
self.popover('show');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment