I want to load my contents for Bootstrap Tooltips dynamic with ajax. So if a user hovers over the button, the data should be loaded and shown in a tooltip.
I am using jQuery 3.6.0 with this little code:
$('document').ready(()=> {
$('.t1').on('mouseover', function(event) {
$.get("MyURL/playground/t1/" + $(this).attr('number'), function ( data ){
console.log(data); // <--- this is working
$(this).attr('data-original-title',data) // <--- this is NOT working :-/
})
$(this).attr('data-original-title','bla bla bla') // <--- this is working
})
})
The strange thing is that every function I need is working but they are not working together. I get my data via $.get() and can put it into my console. I can also change the title for my hovered button.
Maybe someone has experience with jQuery/ajax and bootstrap and can help me here?
Best regards, Niklas