Código HTML:
<html> <head> <title>Coordenadas del cursor</title> <script> var isIE = document.all?true:false; if (!isIE) document.captureEvents(Event.ONCLICK); document.onclick = getMousePosition; function getMousePosition(e) { var _x; var _y; if (!isIE) { document.exf1.sv_x.value = window.pageXOffset; document.exf1.sv_y.value = window.pageYOffset; _x = e.pageX; _y = e.pageY; } if (isIE) { _x = event.clientX + (document.exf1.sv_x.value = document.body.scrollLeft); _y = event.clientY + (document.exf1.sv_y.value = document.body.scrollTop); } document.exf1.cp_x.value=_x; document.exf1.cp_y.value=_y; return true; } </script> </head> <body> <form name="exf1" action="movertd.php" method="get"> <input type="hidden" name="cp_x" size="20" onChange="document.exf1.submit ()"> <input type="hidden" name="cp_y" size="20" onChange="document.exf1.submit ()"> <input type="hidden" name="sv_x" size="20"> <input type="hidden" name="sv_y" size="20"></form> </body> </html>