title: Passing variable via post/get to another file using JQuery/Ajax with changing mouse coordinates
body: <p>I am having index.php which will listens mouse coordinates on moving it. I want to send these coordinates to second file  (say second.php). For this I have placed post fields inside mousemoving activity. But i am unable to receive these values in second.php file. Help me with this thing. I am attaching my code below :</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="jquery-latest.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  jQuery(document).ready(function()
  {
     $(document).mousemove(function(e)
     {
        $('#status').html(e.pageX);
        $('#status1').html(e.pageY);
  
          $.post("second.php",
          {
              x:10,
              y:20
          }, function coord(data)
          {   
              $("#div1").load("second.php");  },"html"
  
          }
  
  
     }); 
  
  
  
  })
  
  &lt;/script&gt;
  &lt;body&gt;
  
  &lt;h2 id='status'&gt;
  &lt;/h2&gt;
  
  &lt;h2 id="status1"&gt;
  &lt;/h2&gt;
  &lt;div id="div1"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and the second file normally receives post values and returns it after addition. Am i going on a wrong track or is there an alternate way for doing this. Help me with it.</p>