title: Reading return values from PHP with Mootools
body: <p>I have been trying to retrieve data via AJAX. I can't seem to be able to 'read' what was sent to me by PHP. Here's the code</p>
  
  <pre><code>  $('create_course').addEvent('submit', function(e){
     e.stop();
     flash.setStyle('display', 'none');
     this.set('send', {
      onComplete: function(resp){
       if ($chk(resp))
       {
        console.log($type(resp));
        if (resp == 'true')
        {
         flash.set('html', resp);
         flash.reveal();
        }
        elseif (resp == 'false')
        {
         $$('div.information').dissolve();
         $$('div.options').reveal();
        }
  
       }
      }
     }).send();
    });
  </code></pre>
  
  <p>A different action will happen when I receive a true and a different one on false.</p>
  
  <p><em>This was the code.</em></p>
  
  <pre><code>  if (is_ajax())
    {
     if ($this-&gt;form_validation-&gt;run('course_create') === TRUE)
     {
      $course = array(
       'name'  =&gt; $this-&gt;input-&gt;post('name'),
       'description'  =&gt; $this-&gt;input-&gt;post('desc'),
       'price' =&gt; $this-&gt;input-&gt;post('price')
      );
  
  
      if ($this-&gt;course-&gt;create($course))
      {
       echo 'true';
      }
      else
      {
       echo 'false';
      }
     }
     else
     {
      echo validation_errors('&lt;div class="message error"&gt;&lt;p&gt;', '&lt;/p&gt;&lt;/div&gt;');
     }
    }
  </code></pre>
  
  <p>Note: I've modified the php and js to just read if there's a response. So this php and js is what is used to be. My point is how do I 'read' the return value in Mootools/JS.</p>