The first part allows linking to a tab on page load via the address bar. So a URL such as, http://website.com/mypage/#my_tab will cause the tab on that page with an ID of “my_tab” to be active.
The second one allows you to link to a tab from anywhere on the page including from within another tab. Also note that internal page links either inside or out of the tabs need to include
<a href="#my_tab" data-toggle="tab">Click me</a>
You can see a working example below: Tab #3 has a link within it to go to tab #2, and there is a page link above all the tabs that will go to tab #3. Make sure the tab nav has the targeted ID that you are specifying for the link.
Here’s a link Jump to Tab #3.
Go back to tab #2.
So there you go… you can now link to any tab on your page, with a unique ID of course, and the correct tab will be set to active.