how to load extrenal url in bootstrap tabs

lets say i have 1.html,2.html and 3.html.

by default when the page is load it should show 1.html when user clicks next tabs it should display 2.html and so on

<body><ul class="nav nav-tabs tabs-up" id="friends">
      <li><a href="contact.jsp" data-target="#contacts" class="media_node active span" id="contacts_tab" data-toggle="tabajax" rel="tooltip"> Contacts </a></li>
    
      <li><a href="searchreport" data-target="#friends_list" class="media_node span" id="friends_list_tab" data-toggle="tabajax" rel="tooltip"> Friends list</a></li>
    
      <li><a href="eventDisplay" data-target="#awaiting_request" class="media_node span" id="awaiting_request_tab" data-toggle="tabajax" rel="tooltip">Awaiting request</a></li>
</ul>

<div class="tab-content">
<div class="tab-pane active" id="contacts">
Contacts
      </div>
      <div class="tab-pane" id="friends_list">
Friends
      </div>
      <div class="tab-pane  urlbox span8" id="awaiting_request">
Awaiting
      </div>
    </div></body>

Open in new window

LVL 20
chaitu chaituAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
A few ways to do it but this will get you started: http://jsbin.com/qofuqu/1/edit?html,js,output
$(function() {
  $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
    var tab = $(e.target.attributes.href.nodeValue); 
    $(tab).load(tab.data('url'));
  });

  $('.nav-tabs a:first').each(function() {
    $(this.attributes.href.nodeValue).load($(this.attributes.href.nodeValue).data('url')); 
  });
});

Open in new window

<!DOCTYPE html>
<html>
  <head>
    <script src="https://code.jquery.com/jquery.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <meta charset="utf-8">
    <title>JS Bin</title>
  </head>
  <body>
    <div role="tabpanel">

      <!-- Nav tabs -->
      <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#contact" aria-controls="contact" role="tab" data-toggle="tab">Contact</a></li>
        <li role="presentation"><a href="#friends" aria-controls="friends" role="tab" data-toggle="tab">Friends</a></li>
        <li role="presentation"><a href="#awaiting" aria-controls="awaiting" role="tab" data-toggle="tab">Awaiting</a></li>
      </ul>

      <!-- Tab panes -->
      <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="contact" data-url="http://jsbin.com/lareza/1/quiet">Loading Contacts...</div>
        <div role="tabpanel" class="tab-pane" id="friends" data-url="http://jsbin.com/piyola/1/quiet">Loading Friends...</div>
        <div role="tabpanel" class="tab-pane" id="awaiting" data-url="http://jsbin.com/cebukaw/1/quiet">Loading Awaiting...</div>
      </div>

    </div>
  </body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.