.on not working.. and if i change the sequence , the other code is not working
Dear All
- <script type="text/javascript">
- $(document).ready(function() {
- $('#searchtable tr').hover(function() {
- $(this).addClass('hover');
- }, function() {
- $(this).removeClass('hover');
- });
- /////////////////////////////////////////////
- $('[id^="fname"]').click(function() {
- var thisid=this.id;
-
- alert(thisid);
-
- });
- /////////////////////////////////////////////
- $('[id^="ob"]').click(function() {
- var thisid=this.id;
-
- var recid=thisid.split('ob');
- var url= "officebearerdivfill.php";
- data = {
-
- id: recid[1]
- }
-
- $('#officebearerdiv').load(url,data) ;
-
- });
- /////////////////////////////////////////////
-
-
- $('#officebearerdiv').on( "click", ".officeb", function() {
- alert("SS");
-
- });
-
- });
- </script>
Command
- $('#officebearerdiv').on( "click", ".officeb", function() {
not working
if i change the sequence
put
- $('#officebearerdiv').on( "click", ".officeb", function() {
- alert("SS");
-
- });
on top
and my code becomes
- $('#searchtable tr').hover(function() {
- $(this).addClass('hover');
- }, function() {
- $(this).removeClass('hover');
- });
- /////////////////////////////////////////////
- $('#officebearerdiv').on( "click", ".officeb", function() { //<<<<< new position of code
- alert("SS");
-
- });
- ////////////////////////////////////////////////
- $('[id^="fname"]').click(function() {
- var thisid=this.id;
-
- alert(thisid);
-
- });
- /////////////////////////////////////////////
- $('[id^="ob"]').click(function() {
- var thisid=this.id;
-
- var recid=thisid.split('ob');
- var url= "officebearerdivfill.php";
- data = {
-
- id: recid[1]
- }
-
- $('#officebearerdiv').load(url,data) ;
-
- });
- //////////////////////////////////
then code
- $('[id^="ob"]').click(function() {
- var thisid=this.id;
-
- var recid=thisid.split('ob');
- var url= "officebearerdivfill.php";
- data = {
-
- id: recid[1]
- }
-
- $('#officebearerdiv').load(url,data) ;
-
- });
is not working
whats wrong with the code ?