title: Uncaught ReferenceError: jqXHR is not defined
body: <p>I am trying to submit login form(which is a popup div) using jquery. If form validation fails then I want display error message on popup div only and stop closing that form(popup) as page gets reload when ajax call enters error function. 
  Here is my js code</p>
  
  <pre><code>$("#loginForm").submit(function(e) {
      var email    = $(".log-email").val();
      var password = $(".log-pass").val();
  
      e.preventDefault();
  
      $.ajax({
          type: "POST",
          url: "/login",
          dataType: "json",
          data: {password:password, email:email},
          success : function(data){
              console.log(data);
              window.location.href= data.redirecturl;
          },
          error:function(XMLHttpRequest,jqXHR, thrownError,ajaxOptions){
              var errors = XMLHttpRequest.responseJSON;
              console.log(XMLHttpRequest);
              if(errors)
              {
                  $(".login-error").text(errors.email);
                  $(".login-error").css("color","red");
              }
              // e.preventDefault();
              jqXHR.error();
              return false;
          }
      });
      // .fail(function(){
      //     e.preventDefault();
      //     e.stopPropagation();
      // });
  });
  </code></pre>
  
  <p>and blade(HTML) code looks like,</p>
  
  <pre><code>&lt;form id="loginForm"&gt;
      {{ Form::email('email', null, ['class' =&gt; 'vbg-input log-email', 'maxlength' =&gt; '191', 'required' =&gt; 'required', 'autofocus' =&gt; 'autofocus', 'placeholder' =&gt; trans('validation.attributes.frontend.email')]) }}
  
      {{ Form::password('password', ['class' =&gt; 'vbg-input log-pass', 'required' =&gt; 'required', 'placeholder' =&gt; trans('validation.attributes.frontend.password')]) }}
  
      &lt;a href="" class="forgot-passw"&gt;Forgot Your Password?&lt;/a&gt;
      &lt;button class="sign-in hover-animation"&gt;
           &lt;span&gt; {{trans('labels.frontend.auth.login_button')}} &lt;/span&gt;
      &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I tried various ways but no success without error. When I use <strong>jqXHR.error();</strong> I am able to stop closing form, but it gives me an error message in the console as,</p>
  
  <pre><code>Uncaught ReferenceError: jqXHR is not defined
  at Object.error (script.js?v=1527662366599:148)
  at fire (frontend.js?id=a613937eec44062691cf:7349)
  at Object.fireWith [as rejectWith] (frontend.js?id=a613937eec44062691cf:7479)
  at done (frontend.js?id=a613937eec44062691cf:13306)
  at XMLHttpRequest.&lt;anonymous&gt; (frontend.js?id=a613937eec44062691cf:13538)
  </code></pre>
  
  <p>Really got stuck at this point. Thanks in advance.</p>