title: PHP jQuery Use Namespace
body: <p>First of all, is PHP's <code>NAMESPACE</code> and <code>USE</code> features compatible with making jQuery ajax requests to handle and return data?</p>
  
  <p>I have set the jQuery AJAX request and PHP handlers up but the code fails at the first hurdle when I make a request to DFP's API. <code>NAMESPACE</code> and <code>USE</code> are declared at top of the php script that the jQuery is being sent to.</p>
  
  <pre><code>use Google\AdsApi\Dfp\v201611\DFPLineItems;
  use Google\AdsApi\Dfp\v201611\GetAvailabilityForecast;
  
  require 'vendor/autoload.php';
  </code></pre>
  
  <p>Error that comes out - </p>
  
  <pre><code>Fatal error: Uncaught exception 'InvalidArgumentException' with message 'file does not exist'.
  </code></pre>
  
  <p>In short that's what happens when the namespaces aren't working when making a request.</p>
  
  <p>If it is possible what tools do I need to make sure <code>NAMESPACE</code> and <code>USE</code> are respected by the jQuery request.</p>
  
  <p>Is there a preference in this scenario to use a particular data type in jQuery to better handle the request like xml, json, script, or html?</p>
  
  <pre><code>    &lt;script&gt;
          jQuery(document).ready(function($) {            
              $(document).on('click','#pbd-alp-load-posts a',function () {
                  var country = $('#country').val();;
                  $.ajax({
                      type: "POST",
                      url: "&lt;?php echo site_url() ?&gt;/wp-content/themes/truemag-child/orders/fetch.php", 
                      data: {country:country},
                      dataType: "html",
                      success: function(response){
                          $("#response_container").append(response);
                          //$('#pbd-alp-load-posts a').blur();
                          //console.log(page*10);                         
                      }
                  });
              return false;
              });
          });
        &lt;/script&gt; 
  </code></pre>