Return single value via AJAX
That will work, but here is how I would do it (in D7). You can set up the ajax callback server side like this:

$response = array('value' =&gt; $condition);
drupal_json_output($response);
drupal_exit();


Then your value will be available as data.value in your success callback:

$.ajax({
  url:example.com/some/path
  success:function(data) {
    alert(data.value);
  }
});