title: Handling ajax request response with wordpress
body: <p>i've done an ajax request in my wordpress plugin.My request is based on steps below:</p>
  
  <p><strong>1) i am including js file and starting a request document on ready</strong></p>
  
  <p><strong>2)At the php side i want to take this request and print it to test.</strong></p>
  
  <p>for all these stuff i wrote these codes:</p>
  
  <p>main.js:</p>
  
  <pre><code> $(function(){      
      $.post('/wp-content/plugins/dsn/functions.php',{token:"1tibu4"},function(data) {
        console.log(data);
      },"json");
   });
  </code></pre>
  
  <p>functions.php:</p>
  
  <pre><code> &lt;?php 
  
     add_action('loop_end', 'init');
  
     function init(){
         global $_POST;
  
         $post= $_POST;   
         echo json_encode($post);Exit;
  
     }
  </code></pre>
  
  <p>My question is when request complete there is nothing on the response tab of console screen.How come this happen?</p>