'; } } else if ($_REQUEST['what'] == 'comment') { // Comment saving code here } exit; ?> 8. That was a lot of PHP code! We are now ready to add JavaScript functions and get recipes! Let's give it a shot. Let's add some code to our recipe.inc. php in the JavaScript section. We will get a recipe if our AJAX test succeeds. Below is this code. The code to make the AJAX call is highlighted.
9. If all went well, you should see something like the following figure in your mobile browser! Chapter 10 [ 191 ] 10.