title: How to send back json data with status(204).send() without refreshing the page in nodejs?
body: <p>I am working in nodejs project with handlebars. I am a beginner in nodejs. I just want to send back some data(it could be a json object) to handlebars template after POST request on the same page without refreshing the page. But I don't know how to do this.</p>
  
  <p>This is the part of code but not the entire code:</p>
  
  <pre><code>router.post('/post/team', (req, res)=&gt;{
      const newTeamPostQuery = newteampost({
          totalOvers: req.body.totalOvers,
          currentMatch: true,
          teamOne: [
              {
                  name: req.body.teamOne,
                  over: 0
              }
          ],
          teamTwo: [
              {
                  name: req.body.teamTwo,
                  over: 0
              }
          ]
      });
  
      newTeamPostQuery.save().then(savedPost=&gt;{
          res.status(204).send({data: savedPost});
      }).catch(error=&gt;{
          console.log(error);
      });
  });
  </code></pre>
  
  <p>I don't want to refresh the page. When I use this <code>res.json({data: newTeamPostQuery});</code> then it refreshes the page to this <code>/post/team</code> route and show the json data on the page.</p>
  
  <p>I am using handlebars to show data like this:
  <code>{{#if data.currentMatch}} data.totalOvers {{else}} Overs {{/if}}</code></p>
  
  <p>I am using mongodb.</p>