Guest User

Untitled

a guest
Jan 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. function getChildren(parent, list, base) {
  2. var url = base + '/ajax/getChildren.php?parent=' + parent;
  3. loadOptions(list, url);
  4.  
  5. $(document).ready(function() {
  6.  
  7.  
  8. var idgenus = $('#r_genus').children(":selected").val();
  9. var idspecies = $('#r_species').children(":selected").val();
  10.  
  11. if (idgenus != 0) {
  12. alert(idgenus);
  13. $.ajax({
  14. type: "GET",
  15. url: base + '/ajax/getData.php?id=' + idgenus,
  16. success: function(data){
  17.  
  18.  
  19. $('.genusbox').html(data);
  20. $('.genusbox').fadeIn("slow");
  21.  
  22. } //end sucess
  23.  
  24.  
  25. }); // end ajax call
  26.  
  27. } else {
  28.  
  29. $.ajax({
  30. type: "GET",
  31. url: base + '/ajax/getData.php?id=' + id,
  32. success: function(data){
  33.  
  34. alert(idspecies);
  35. $('.speciessbox').html(data);
  36. $('.speciesbox').fadeIn("slow");
  37.  
  38. } //end sucess
  39.  
  40.  
  41. }); // end ajax call
  42.  
  43.  
  44. }
  45. return false;
  46. }); //doc ready
  47. }
Add Comment
Please, Sign In to add comment