title: ajax request, but refresh the whole page?
body: <p>When ajax request gets 401 response, I show login <strong>modal</strong>. </p>
  
  <p>When ajax request gets 200 response, I want to load the response html.  </p>
  
  <pre><code>$.ajaxSetup({
      statusCode: {
        401: function(){
          //do something
        });
      }
   });
  
  $.ajax({
      url: url,
      context: document.body,
      success: function(response) {
        $(this).html(response);
      }
    });
  </code></pre>
  
  <p>But it doesn't update the url, and actually it has some problem with requirejs which I cannot describe succinctly (it spits error <code>Uncaught TypeError: Property 'require' of object [object Object] is not a function</code>) </p>
  
  <p>The question is, how do I simulate the regular request/response when the request is actually made via ajax?</p>