title: Cannot get Ajax script to work for PHP login page
body: <p>I am  have a problem when using Ajax to send data to a Mysql database without refreshing the page.</p>
  
  <p>Can anyone please point out where I might have gone wrong? I placed an alert: <code>alert('it worked');</code> in the AJAX on success part of the script to see what happened. It also returns "it works".</p>
  
  <p>(I have removed the validation part of script for ease of reference, but I do have it.)</p>
  
  <p>I also  checked the values that were returned from the variable dataString: </p>
  
  <pre><code>email =a3&amp;pass=a
  </code></pre>
  
  <p>I have no idea why it's not sending the values to the PHP page. </p>
  
  <pre><code>//START THE FUNCTION FOR THE SUBMISSION OF THE LOGIN FORM VIA AJAX 
  
  $('form[name=loginForm]').submit(function(e) { 
      e.preventDefault();
  
      var email = $("#email").val();
      var password = $("#pass").val();
  
      var dataString = 'email =' + email + '&amp;pass=' + password;
  
      //the html below is just used to test the values that are derived from the dataStirng. 
      $('#showerror').html( dataString  );
  
      $.ajax({
          type: "POST",
          url: "cms/index.php?view=login",
          data: dataString,
          success: function() {
              alert('it worked');
              //document.newMessage.newMessageContent.value = "";
          }
      });     
  });  
  //END THE FUNCTION FOR THE SUBMISSION OF THE LOGIN FORM VIA AJAX  
  </code></pre>