title: How do I catch JSON parse errors with JQuery JSON calls?
body: <p>I'm making AJAX calls to a server that sometimes return unparseable JSON. The server isn't under my control, so I can't fix that.</p>
  
  <pre><code>function eventFunction(evt) {
      $('div#status_bar').show();
      $.ajax({
          url: 'http://buggyserver.com/api/',
          type: 'GET',
          data: { 'mode': 'json', 'q': 'get/data' },
          dataType: 'json',
          success: updateForm
      });
  }
  
  function updateForm(returned, status) {
      if (status == 'success') {
          //Update the form here
      }
      $('div#status_bar').hide();
  }
  </code></pre>
  
  <p>When unparseable JSON is returned, the <code>updateForm</code> functions does not get called.</p>
  
  <p>How can I, on the client side, ensure that the last line of the <code>updateForm</code> function gets called to hide the status bar when? I've tried putting <code>try { } catch {}</code> clauses around both the AJAX call and the updateForm.</p>