title: How do I change the output of the success function based on a variable using jQuery/Ajax?
body: <p>On success, I would like to show different values depending on what value exists.  For example, if $('#add').val() has a value in it I would like to show 'Video added" as part of the success function.  If $('#remove').val() has a value in it, I would like to show 'Video removed' as part of the success function.  Either #add or #remove will have a value in it at a given time.  How do I enable this?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     $(document).ready(function() {
         $("#test").submit(function(event){
         event.preventDefault();
              $.ajax({
                   type:"POST",
                   url:"/edit_favorites/",
                   data: {
                          'video_add': $('#add').val(), // from form
                          'video_remove': $('#remove').val() // from form
                          },
                   success: function(){
                       $('#message').html("&lt;h2&gt;Video added!&lt;/h2&gt;") 
                      }
              });
              return false;
         });
  
      });
  &lt;/script&gt;
  </code></pre>