title: Uncaught TypeError: $.ajax(...).error is not a function
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;meta charset="utf-8"&gt;
   &lt;title&gt;jquery examples - 4&lt;/title&gt;
   &lt;link rel="stylesheet" type="text/css" href="css/style2.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;input id="name" type="text" name=""&gt;
  &lt;input id="button" type="button" value="load" name=""&gt;
  &lt;div id="content"&gt;&lt;/div&gt;
  &lt;script type="text/javascript" src="js/jQuery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/selectors12.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#button').click(function() { 
  var name = $('#name').val();
  
      $.ajax({
       url:'php/page.php',
       data: 'name='+name, //sending the data to page.php
       success: function(data) {  
        $('#content').html(data);
  
       }
       
      }).error(function() { 
       alert('an error occured');
  
      }).success(function() { 
       /*alert*/
       alert('an error occured');
      }).complete(function() { 
       /*alert*/
      });
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>the <code>error()</code> is not working, when I change the URL: to <code>page.php</code> with incorrect extension to check for an <code>error()</code> and display it.</p>
  
  <p>But, in console it displays an error saying: </p>
  
  <blockquote>
    <p>Uncaught TypeError: $.ajax(...).error is not a function</p>
  </blockquote>