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 :
<html>
<head>
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript">
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"
}
});
})
</script>
<body>
<h2 id='status'>
</h2>
<h2 id="status1">
</h2>
<div id="div1"></div>
</body>
</html>
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.
)instead}after"html"