title: Prevent return to client's ajaxSubmitHandler
body: <p>On the front end ejs page, I have a ajaxSubmit handler function like this.</p>
  
  <pre><code>    $('#submitDetails').submit(function() {
      $(this).ajaxSubmit({
        error: function(xhr) {
          alert('Error: ' + xhr.status);
        },
       success: function(response) {
  
        if (response.responseCode == 1) {
          alert("There is an error. Please try again!");
        } else {
          //do nothing
        }
    }
       });
       };
  </code></pre>
  
  <p>On the server side, I have a nodejs routing module with get and post methods. For the above submit button click, I am calling a post 
  route. Like below</p>
  
  <pre><code>route.post('/submit', (req, res, next) =&gt; {
  
      if (dataRetrieved == 1 || dataRetrieved == 2) {
              return res.json({"responseCode" : dataRetrieved});
      } else {
          res.render('someOtherPage');
      }
  </code></pre>
  
  <p>When the application works without any server issue, the else block only executes. As you could see, I want to render some other page inside my else block and do not wish to return res.json to the ajaxSubmit handler. It is not allowing me to do that. As soon as it sees res.render, it goes back to that submitHandler function. Is there a way to prevent this?</p>