Getting paginated data from ajax call and putting the data on the page
When you have an if/else statement inside an else statement and that is the only thing inside that statement, you should make the else statement into and else if instead.  So you would change this:


     if (value.image[0]) {
       image = value.image[0].name;
     } else {
       if (value.profile.gender == 'male') {
         image = 'maleDefault.png';
       } else {
         image = 'femaleDefault.jpg';
       }
     }



to this

if (value.image[0]) {
   image = value.image[0].name;
} else if (value.profile.gender == 'male') {
     image = 'maleDefault.png';
} else {
     image = 'femaleDefault.jpg';
}


All that this does is remove a level of indentation to make the code easier to read.