title: Unable to pass data to servlet using jquery
body: <p>I am developing an application using jquery along with servlets.I have been using jquery theme roller for interface
  In my Login.jsp </p>
  
  <pre><code> &lt;script&gt;
   $(document).ready(function() {
   $("#dialog").dialog();
   }); 
   &lt;/script&gt;
  
   &lt;script&gt;
   $("#submit").click(function(){
     $.ajax({
         type:post,
         url:"LoginServlet.java",
         data:{
         username:$('#username').val(),
         password:$('#password').val() }    
     });   
    });
   &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body style="font-size:62.5%;"&gt;
  &lt;div id="dialog" title="Login"&gt;
  &lt;form id="LoginForm" method="post"&gt;
  &lt;fieldset&gt;
  &lt;label&gt;Username:&lt;/label&gt;
  &lt;input type="text" id="username"&gt;&lt;/input&gt;&lt;br&gt;&lt;/br&gt;
  &lt;label&gt;Password:&lt;/label&gt;
  &lt;input type="password" id="pwd"&gt;&lt;/input&gt;&lt;br&gt;&lt;/br&gt;
  &lt;input type="submit" id="submit" value="Log In" align="middle"&gt;&lt;/input&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In my LoginServlet I check for if the password and username matches and if it matches I am redirecting the user to other page using <code>response.sendRedirect().</code>But when I enter the credentials the data is not been passed to the servlet.Also I don get any errors(checked with firebug) or exceptions of any kind...</p>
  
  <p>I am fairly new to jquery as well as java.Where have I gone wrong</p>
  
  <p>I tried <code>$("#LoginForm").submit(function(){  }</code> also.Why there are no errors being thrown?? How do I know where am I going wrong</p>