ClarusDignus

Solution: Return two database results with the one jQuery

May 25th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. ***************************************
  2. PART 2 - JQUERY AJAX:
  3. ***************************************
  4. var parsedData = JSON.parse(data);
  5. var buildproject = parsedData.buildproject;
  6. var prospectstrength = parsedData.prospectstrength;
  7.  
  8. if (buildproject == null){
  9.     //jQuery applied here.
  10. }
  11. else{
  12.     //jQuery applied here.
  13. }
  14.  
  15. if (!$.trim(prospectstrength)){
  16.     //jQuery applied here.
  17. }
  18. else{
  19.     //jQuery applied here.
  20. }
  21.  
  22. ***************************************
  23. PART 1 - PHP:
  24. ***************************************
  25.            
  26. $myArray = array("buildproject" => $buildproject, "prospectstrength" => $prospectstrength);
  27. echo json_encode($myArray);
Advertisement
Add Comment
Please, Sign In to add comment