title: AJAX GET is not getting JSON encoded object
body: <p>I'm trying to get a JSON encoded object from a PHP file via AJAX GET using jQuery. I'm not exactly sure what's wrong. Here's my request in Javascript:</p>
  
  <pre><code>function getInfo()
  {
      $.ajax({
          url:'ajax/ipGet.php',
          type: 'GET',
          dataType:'json',
          success:function(response){
              console.log(response);
          }
  
      });
  }
  </code></pre>
  
  <p>ajax/ipGet.php</p>
  
  <pre><code>&lt;?php
  include 'dbcon.php';
  
  
  class ipInfo {
      private $ipAddress;
      private $status;
      private $serialNumber;
  }
  
  $ipInfo = new ipInfo;
  $ipInfo-&gt;$ipAddress = "IP ADDRESS";
  $ipInfo-&gt;$status = "ONLINE";
  $ipInfo-&gt;$serialNumber = "TEST";
  
  echo json_encode($ipInfo);
  
  ?&gt;
  </code></pre>
  
  <p>I used GET because the user doesn't need to be redirected eventually. The PHP file will eventually retrieve values from a database.</p>