title: How to stay at the same page after submitting post request with Express?
body: <p>I know this might be a simple question but I just didn't find the solution I want. I write a post route with express. like this:</p>
  <pre class="lang-js prettyprint-override"><code>app.post('/search', function(req, res){
      // Some code to get data from req and save data to db
      // Then want to stay current page.
  });
  </code></pre>
  <p>My html:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form action=&quot;/search&quot; method=&quot;post&quot;&gt;
       &lt;input value=&quot;name&quot; name=&quot;marker[name]&quot;&gt;
       &lt;input value=&quot;address&quot; name=&quot;marker[address]&quot;&gt;
       &lt;input value=&quot;rating&quot; name=&quot;marker[rating]&quot;&gt;
  
       &lt;button id=&quot;favo-button&quot; type=&quot;submit&quot;&gt;
           Submit
       &lt;/button&gt;
   &lt;/form&gt;
  </code></pre>
  <p>When user click submit button, the data sent through req to the post route, and there insert to db. Then I want the page not direct to anywhere but stay current page. I tried some ways but not handle it very well. what I tried:</p>
  <ol>
  <li>in the route,</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>res.render('/search');
  </code></pre>
  <p>this makes the page re-render with the same view, but the page will flash because of the re-render.</p>
  <ol start="2">
  <li>don't do anything to the res in the route, then the page loading circle will never stop.</li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>app.post('/search', function(req, res){
      var data = req.body.marker;
      // some code insert data to db
      // then do nothing to res. The page will stay but keep loading.
  });
  </code></pre>
  <p>Is there a way to just do nothing to <code>res</code> and stay, meanwhile not keep the page loading?</p>