title: How to re-render the page after a database add call without refreshing?
body: <p>Hi I am using a form which takes input of some data and when I press submit an Ajax Post request goes to the server which then saves the data in the database and then data only gets updated on the ejs Page when I press refresh.
  I want to know is there any way I can make any call through either Jquery or JavaScript that on the success of AJAX POST re renders the ejs page and page is again functional without refreshing? </p>
  
  <p>I tried to use the below code to re load the page what it does is; it works, reloads the data but that data is not accessible or its values are not usable until I refresh</p>
  
  <p>The code I used</p>
  
  <pre class="lang-js prettyprint-override"><code>             $('body').load('views/test.ejs', function () {
                $(this).fadeIn(5000);
             });
  </code></pre>
  
  <p>My rendering function looks like this;</p>
  
  <pre><code>         function renderList(res, list) {
              res.render('admin', {
                  jsonList: list, // JSON of data generated from DB
                  listId:   req.session.user.listID, //global session
                  access: req.session.user.Access, //global session
                  products:   req.session.user.Products, //global session
                  user:       req.session.user.FirstName || req.session.LastName 
              });
          }
  </code></pre>
  
  <p>I have a tabbable menu of bootstrap in which I am passing the IDs of the data from Databases and using those tabbable menu to display corresponding data of that item. So I am not getting IDs when I just use the Load function. only <code>location.reload()</code> works for me but its not a good way to do it.</p>