title: After POST request, don't get into success call back (javascript)
body: <p>My problem is that the page which requested a post request is gone, and then just shows me a JSON data string which come from server. Please let me know how can I just get the response data without redirecting(?) page. </p>
  
  <p><strong>Client POST Request</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Login Form&lt;/title&gt;
  
    &lt;script
      src="https://code.jquery.com/jquery-3.1.1.min.js"
      integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
      crossorigin="anonymous"&gt;&lt;/script&gt;
    &lt;link rel="stylesheet" type="text/css" href="../../semantic/dist/semantic.min.css"&gt;
    &lt;link rel="stylesheet" type="text/css" href="../../semantic/dist/login.css"&gt;
    &lt;script
      src="https://code.jquery.com/jquery-3.1.1.min.js"
      integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
      crossorigin="anonymous"&gt;&lt;/script&gt;
    &lt;script src="semantic/dist/semantic.min.js"&gt;&lt;/script&gt;
  
  
    &lt;script type="text/javascript"&gt;
        $(document).ready(function() {
          $("#submit").click(function() {
              var form_data = {
                  user_id: $("#user_id").val(),
                  user_pw: $("#user_pw").val(),
                  is_ajax: 1
              };
              $.ajax({
                  type: "POST",
                  url: '/',
                  data: JSON.stringify(form_data),
                  contentType: "application/json",
                  dataType: "json",
                  success: function(response) {
                      console.log('test');
                  },
                  error : function(response){
                      console.log('test');
                  }
              });
          });
        });
        &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="ui one column center aligned grid"&gt;
  &lt;div class="column six wide form-holder"&gt;
    &lt;h2 class="center aligned header form-head"&gt;Sign in&lt;/h2&gt;
    &lt;div class="ui form"&gt;
    &lt;form class="form-signin" method="post"&gt;
      &lt;div class="field"&gt;
        &lt;input type="text" name = "user_id" placeholder="Email"&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;input type="password" name = "user_pw" placeholder="password"&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;input type="submit" value="sign in" class="ui button large fluid green"&gt;
      &lt;/div&gt;
      &lt;div class="field"&gt;
        &lt;CENTER&gt;&lt;h5&gt;&lt;a href = "/register"&gt;Register&lt;/a&gt;&lt;/h5&gt;&lt;/CENTER&gt;
      &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Server POST Response</strong>                 </p>
  
  <pre><code>res.writeHead(200, {
  'Content-Type': 'application/json'
  });
  res.end(JSON.stringify({message : "success"}));
  </code></pre>
  
  <p><strong>result</strong><BR>
  {"message":"success"}   </p>