title: Getting JSON result after POST
body: <p>I'm currently trying to <code>POST</code> a Submit form with an input for search and get the results via <code>JSON</code>. All project is a Web App that search in some XMLs files for get the POST results.</p>
  
  <p>My form in my index.html starts like this:</p>
  
  <pre><code>&lt;form method="post" action="/results"&gt;
  </code></pre>
  
  <p><strong>/results is the page where are JSON results in plain text.</strong></p>
  
  <p>In other hand, in my script I am trying to get JSON results like this:</p>
  
  <pre><code>$("#buttonid").on('click',function(){
      $.ajax({
          url:'/results',
          dataType: 'json',
          type: 'post',
          cache: false,
          success: function(data){
              $(data).each(function(index,value){
                  console.log(value);
  
              });
          }
      });
  };
  </code></pre>
  
  <p>I can't see the results by console. What can I do? Any advice for solve my problem?</p>
  
  <p><strong>Edited:</strong></p>
  
  <p>Isn't only a simple typographical error, I solved the issue deleting <code>action="/results"</code> in my form and adding <code>data: $(this).serialize(),</code> in ajax options. Thanks to @foxygen.</p>