Hi,

I'm using the following code on the client side:
   $.ajax({
      dataType : 'json',
      // other options
      success : function(json_response)  {
         console.log(typeof response, response);   // Using Firefox's
firebug
      }
   });

And this PHP code on the server side:

<?php
   // php processing code
   $response = some_boolean_value();
   print json_encode($response);
?>

Now, using Firebug, I can verify that the actual JSON response coming
back is indeed either   true   or   false   (without the quotes),
which should evaluate to Javascript boolean true or false.  However,
when I obtain it in the success() method of my $.ajax() call, it comes
in as a string.  (e.g.  "true"  or  "false").  i.e., the console.log()
call renders:   string true

Shouldn't it render:   boolean true  ?

Is this a bug?
Jamie

Reply via email to