JQuery和Ajax:如何在变量中存储返回的数据?

I have the following code:

  window.onload = function() {  
      var eMail = "<?php echo $log; ?>"; 
      var aRticleid = "<?php echo $articleid1; ?>"; 
      $.ajax({
              type: "GET",
              url: 'aquireLikes.php?email='+eMail+'&id='+aRticleid+'',
              success: function(data){
              }
          });
      };

This executes a php script. There is three variables in the PHP script that gets set to true if certain conditions are met. I want to store the returned value of these variable in a set of JavaScript variables on my page that call the aquireLikes.php page. How can I do this? It would be something like this but actually works:

  window.onload = function() {  
      var eMail = "<?php echo $log; ?>"; 
      var aRticleid = "<?php echo $articleid1; ?>"; 
      $.ajax({
              type: "GET",
              url: 'aquireLikes.php?email='+eMail+'&id='+aRticleid+'',
              success: function(data){

                var liked = aquirelikes.php.$liked;
              }
          });
      };

I know above is complete nonsense but you get the hint. So how can I store the returned values in javascript variables? Here is my aquireLikes file:

    <?php

    $email = $_GET["email"];
    $articleid1 = $_GET["id"];
    $done = false;

     $thing = mysql_query("SELECT `id` FROM likes WHERE id=(SELECT MAX(id) FROM likes)");
     $lastrow = mysql_fetch_row($thing);
     $lastid = $lastrow[0];

     if($lastid == null || $lastid == '0'){
       $lastid = '1';
     }   

     $state1 = '';

     for ($i=1; $i <= $lastid+1; $i++) { 
        $current = mysql_query("SELECT * FROM likes WHERE id=$i");
        while ($row = mysql_fetch_array($current)) {
           $id1 = $row[0];
           $userid1 = $row[1];
           $state1 = $row[2];
           $articleid1 = $row[3];
       if($done == false){
         if($email == $userid1 && $articleid1 == $id && $state1 == '1'){
          $liked = true;
          $disliked = false;
          $done = true;
          echo "<script>console.log('Liked!');</script>";
          break;
         }else{
          $liked = false;

         }
         if($email == $userid1 && $articleid1 == $id && $state1 == '0'){
          $disliked = false;
          $liked = false;
          $done = true;
          echo "<script>console.log('NONE!');</script>";

          break;
         }
         if($email == $userid1 && $articleid1 == $id && $state1 == '2'){
          $disliked = true;
          $liked = false;
          $done = true;
          echo "<script>console.log('disliked!');</script>";

          break;
         }else{
          $disliked = false;
         }
       }
      }


     }





?>

Your ajax would look like this:

    var liked;
    $.ajax({
          type: "GET",
          url: 'aquireLikes.php?email='+eMail+'&id='+aRticleid+'',
          type: 'json',
          success: function(data){

            liked = data.liked;
          }
  });

And in php you would have to return:

echo json_encode($data)

Php file has to output only json data!

This is just example of implementation.