title: JQuery/AJAX/PHP Error in Chrome Only: Unexpected token ILLEGAL
body: <p>Using jQuery to make an AJAX call to a PHP file results in the following error in Chrome only: SyntaxError: Unexpected token ILLEGAL</p>
  
  <p>jQuery Snippet:</p>
  
  <pre><code> $.ajax({
      type: 'POST',
      url: 'ajax/Test_Get.php',
      dataType: 'json',
      data: {
          ID: settings.ID
      },
      success: function(data) {
          console.log('ok');
      },
      error: function(XMLHttpRequest, textStatus, errorThrown) {
      }
          console.log('error');
      });
  </code></pre>
  
  <p>PHP Snippet:</p>
  
  <pre><code>...
  header('Cache-Control: no-cache, must-revalidate');
  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Content-Type: application/json; charset=utf-8');
  
  require_once('../classes/Database.php');
  require_once('../classes/Test.php');
  ...
  </code></pre>
  
  <p>I spent hours researching this issue and there are a few posts on stackoverflow that talk about problem characters etc. but I haven't been able to solve this.</p>
  
  <p>The specific problem here appears to be having another <code>&lt;?php</code> block on the page (whether it be as part of an include file or added directly to the page).  So because the Test.php file has a <code>&lt;?php</code> block in it I can't include this class.  Other browsers work just fine but not Chrome.</p>
  
  <p>The only bad work around I've been able to find is to copy and paste the class code directly within the existing <code>&lt;?php</code> block on the page.  This just doesn't seem right -- there must be something fundamental I'm missing here.</p>