1

I was trying to implement dynamic tabs by following this link. It is straightforward to use. But to use this, all the HTML data should be on the same HTML file. How can I keep my HTML data in another file and use it when the respective tab is clicked?

Edit: I don't want the URL to change depending on the tab.

as2d3
  • 802
  • 2
  • 10
  • 27

1 Answers1

0

you can use load external file data on shown.bs.tab function using jQuery .load(). for updated reference you can go http://api.jquery.com/load/

$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  e.target // newly activated tab
  e.relatedTarget // previous active tab
  // call jquery load() here
})
Super User
  • 9,448
  • 3
  • 31
  • 47