How do you reload the currently selected Twitter Bootstrap tab?
This is what I have so far, but it just makes any subsequent tabs reload multiple times.
function reload_tab() {
$('a[data-toggle="tab"]').on('shown', function (e) {
$('#tab-loaded-content').load($(e.target).attr('href'));
});
}
Try just
What you were doing is every time you call the reload function, it binds to the
shownevent (didn’t know that existed honestly) to reload that tab. Call it twice, tabs will reload twice. not what you want!The one liner above simply tells it to load the content from the
hrefattribute of the link that is a child of the active tabli.active.