javascript - get the details corresponding to particular tab on click of it -


html part:

<div class="tab-content">     <div class="tab-pane active" id="tab2">         <div class="row-fluid">             <div class="span9 offset1">                 <header id="second">                     <strong>users</strong>             </div>             <div class="span2">             <div class="tabbable" align="center">                 <ul class="nav nav-pills">                     <li class="active"><a href="#mobile" data-toggle="tab"><strong>mobile</strong>                     </a>                     </li>                     <li><a href="#bo" data-toggle="tab"><strong>bo</strong>                     </a>                     </li>                  </ul>             </div></div></div></div></div></div> 

javascript part;

var users;          $(document).ready(function() {             jquery.support.cors = true;             loadusers('mobile');         });          function loaduserdetails(id) {             $.get('http:somelink' + id, function(data) {          }           function test(name)         {             alert("test");         }          function loadusers(type) {               $.get('http://some link' + type, function(data) {                 }); } 

in code default type mobile want if click on bo tab javascript function works according that. how can achieve that

you need add click handler

jquery(function($) {     $('.tabbable ul li').click(function() {         var id = $(this).find('a').attr('href').substring(1);         loadusers(id);     }) }) 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -