console.log not working within jquery ajax function
<p>I'm using Chrome's developer tools and for some reason SOME of my console.log code isn't working. I have code like this:</p>

<pre><code>$(document).ready(function() {
  console.log("wtf"); //this shows in the console
  $.ajax({
    url: 'get_data.php',
    type: 'GET',
    dataType: 'JSON',
    success: function(data) {
      console.log(data); //this does not show in the console.
    }
  });
});
</code></pre>

<p>I know that data is being sent from my PHP file because I can see it in my network tab.</p>

<p>Console.log is also working fine with other code that I have. What's going on here?</p>

<p>EDIT:</p>

<p>Apparently, it's not getting into my <code>success</code> function because of an issue with the data. I changed around my PHP code and was able to get console.log to show the right data.</p>

<p>So, why is <code>success</code> handler not working? Here's the relevant part of my PHP:</p>

<pre><code>$result = $dbh-&gt;query($sql)-&gt;fetchAll(PDO::FETCH_ASSOC);
$json= json_encode($result);
$someArray = json_decode($json, true);
  foreach ($someArray as $key =&gt; $value) {
    echo $value["category"] . ", ";
  }
</code></pre>