Created
          July 26, 2015 20:58 
        
      - 
      
 - 
        
Save himstar/fb27f51a83a24d213902 to your computer and use it in GitHub Desktop.  
    Learning Ajax in 5 Min Quick Clear Concepts
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script src="js/jquery-1.10.1.js"></script> | |
| <script> | |
| function test(fruit) | |
| { | |
| $.post('process.php',{name:fruit},function(data) | |
| { | |
| $('#a').html(data); | |
| }); | |
| } | |
| </script> | |
| <select name="fruit" onChange="test(this.value)"> | |
| <option value="">Select Fruit</option> | |
| <option value="mango">Mango</option> | |
| <option value="apple">Apple</option> | |
| </select> | |
| <div id="a"> | |
| </div> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| $name= $_POST["name"]; | |
| if ($name=="mango") | |
| { | |
| $taste ="Sweeter"; | |
| $color ="Yellow and Green"; | |
| } | |
| elseif ($name="apple") | |
| { | |
| $taste ="Sweet"; | |
| $color ="Red"; | |
| } | |
| echo "Taste---------".$taste."<br>"."Color--------".$color; | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment