Created
          December 13, 2012 21:15 
        
      - 
      
- 
        Save jlittlejohn/4279973 to your computer and use it in GitHub Desktop. 
    JS: Ajax Template
  
        
  
    
      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
    
  
  
    
  | $.ajax({ | |
| type: 'POST', | |
| url: 'backend.php', | |
| data: "q="+myform.serialize(), | |
| success: function(data){ | |
| // on success use return data here | |
| }, | |
| error: function(xhr, type, exception) { | |
| // if ajax fails display error alert | |
| alert("ajax error response type "+type); | |
| } | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment