.on not working.. and if i change the sequence , the other code is not working

.on not working.. and if i change the sequence , the other code is not working

Dear All

  1. <script type="text/javascript">
  2. $(document).ready(function() { 
  3. $('#searchtable  tr').hover(function() {
  4. $(this).addClass('hover');
  5. }, function() {
  6. $(this).removeClass('hover');
  7. });
  8. ///////////////////////////////////////////// 
  9. $('[id^="fname"]').click(function() {
  10. var thisid=this.id;
  11.  
  12. alert(thisid);
  13. });
  14. ///////////////////////////////////////////// 
  15. $('[id^="ob"]').click(function() {
  16. var thisid=this.id;
  17.  
  18. var recid=thisid.split('ob');
  19.   var url= "officebearerdivfill.php";
  20. data = {
  21.  
  22.  id: recid[1]
  23. }
  24.  
  25. $('#officebearerdiv').load(url,data)  ;
  26. });
  27. /////////////////////////////////////////////      
  28.  
  29.  
  30. $('#officebearerdiv').on( "click", ".officeb", function() { 
  31. alert("SS");
  32.  
  33.  });  
  34.   
  35. });   
  36. </script> 

Command
  1. $('#officebearerdiv').on( "click", ".officeb", function() { 
not working
if i change the sequence

put 
  1. $('#officebearerdiv').on( "click", ".officeb", function() { 
  2. alert("SS");
  3.  
  4.  });  
on top
and my code becomes
  1. $('#searchtable  tr').hover(function() {
  2. $(this).addClass('hover');
  3. }, function() {
  4. $(this).removeClass('hover');
  5. });
  6. ///////////////////////////////////////////// 
  7. $('#officebearerdiv').on( "click", ".officeb", function() { //<<<<< new position of  code 
  8. alert("SS");
  9.  
  10.  });  
  11. ////////////////////////////////////////////////  
  12. $('[id^="fname"]').click(function() {
  13. var thisid=this.id;
  14.  
  15. alert(thisid);
  16. });
  17. ///////////////////////////////////////////// 
  18. $('[id^="ob"]').click(function() {
  19. var thisid=this.id;
  20.  
  21. var recid=thisid.split('ob');
  22.   var url= "officebearerdivfill.php";
  23. data = {
  24.  
  25.  id: recid[1]
  26. }
  27.  
  28. $('#officebearerdiv').load(url,data)  ;
  29. });
  30. //////////////////////////////////
then code
  1. $('[id^="ob"]').click(function() {
  2. var thisid=this.id;
  3.  
  4. var recid=thisid.split('ob');
  5.    var url= "officebearerdivfill.php";
  6. data = {
  7.   
  8.   id: recid[1]
  9. }
  10.   
  11. $('#officebearerdiv').load(url,data)  ;
  12. });
is not working

whats wrong with the code ?