title: Wordpress AJAX Login
body: <p>I am trying to build a custom wordpress ajax login form but I can't get it sorted. Here is the codes I use:</p>
  
  <p>HTML:</p>
  
  <pre><code>            &lt;form class="well form-inline" id="login"&gt;
                  &lt;div class="rowmargin"&gt;
                      &lt;h4&gt;Login&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="rowmargin"&gt;
                      &lt;input type="text" name="username" id="loginUsername" class="input-medium" placeholder="Username"&gt;
                      &lt;input type="password" name="password" id="loginPassword" class="input-medium" placeholder="Password"&gt;
                  &lt;/div&gt;
                  &lt;a class="btn btn-primary" id="loginButton"&gt;&lt;i class="icon-check icon-white"&gt;&lt;/i&gt; Login&lt;/a&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  
          $(document).ready(function() {
  
              $("#loginButton").click(function() {    
  
                  var username = $('#loginUsername').val();
                  var password = $('#loginPassword').val();
                  var rememberme = "forever";
                  var redirect = '&lt;?php bloginfo('url'); ?&gt;';
  
                  var data = {
                      user_login:     username,
                      user_password:  password,
                      remember:       rememberme,
                      redirect_to:    redirect
                  }
  
                  $.ajax({
                      url: '&lt;?php bloginfo('url'); ?&gt;/wp-login.php',
                      data: data,
                      type: 'GET',
                      dataType: 'jsonp',
                      success: function( result ) {
                          if (result.success==1) {
                              alert("Ok!");
                          } else {
                              alert("Not Ok!");
                          }
                      }
                  }); 
  
              });
  
          });
  
          &lt;/script&gt; &lt;!-- Login Script ---&gt;
  </code></pre>
  
  <p>Can someone tell me what am I doing wrong here?</p>