<body onmousemove="move();">
</body><script>
 function move(){
   document.body.innerHTML=document.body.innerHTML+"<br>x:"+window.event.x+"y:"+window.event.y;
 }
</script>

解决方案 »

  1.   

    根据你的代码改良后得到如下代码:
    <script   language="javascript">   
      var   where   =   ""; 
    var str = "";  
    var x=y="";
      function   checkwhere(e)   {   
                      if   (document.layers){   
                      xCoord   =   e.x;   
                      yCoord   =   e.y;   
      }   
                      else   if   (document.all){   
                      xCoord   =   event.clientX;   
                      yCoord   =   event.clientY;   
      }   
                      else   if   (document.getElementById){   
                      xCoord   =   e.clientX;   
                      yCoord   =   e.clientY;   
      }   
    if(x==xCoord&&y==yCoord)return;//如果和上次坐标相同的未移动不记录
    x=xCoord;
    y=yCoord;
    str +=   "X座标值=   "+   xCoord   +   "     Y座标值=   "   +   yCoord   ; 
                      document.title = str
    status=str;
    site.innerHTML=str;
                      }   
      document.onmousemove   =   checkwhere;     if(document.captureEvents)   {document.captureEvents(Event.MOUSEMOVE);}   
      </script>  
    <body onmousemove=checkwhere>
    <div id=site></div>
    </body>
      

  2.   

    <script   language="javascript">   
      var   where   =   ""; 
    var str = ""; 
    var xCoord,yCoord 
    var first=true;
    function getxy(){
                      if   (document.layers){   
                      xCoord   =   e.x;   
                      yCoord   =   e.y;   
      }   
                      else   if   (document.all){   
                      xCoord   =   event.clientX;   
                      yCoord   =   event.clientY;   
      }   
                      else   if   (document.getElementById){   
                      xCoord   =   e.clientX;   
                      yCoord   =   e.clientY;   
      }   
    }  function   checkwhere(e)   {   if(!first) return;
    getxy();
    first=false;
    str +=   "X: "+   xCoord   +   " Y: "   +   yCoord   +"<br>";            
    site.innerHTML=str;
       }   
    function click(){
    getxy();
    str +=   "X: "+   xCoord   +   " Y: "   +   yCoord   +"<br>";            
    site.innerHTML=str;
    }
     
    document.onmousemove   =   checkwhere;
    document.onmouseup = click;  if(document.captureEvents)   {document.captureEvents(Event.MOUSEMOVE);}   
      </script>  
    <body onmousemove=checkwhere>
    <div id=site></div>
    </body>调试通过。
      

  3.   

    谢谢myvicy(看着远方,走脚下的路。) 的兄弟,你能留一个QQ给我吗?我的QQ是:81832527
    我作这鼠标坐标,就是获取别人点我这网页的时候,别人在这网页里的活动轨迹,我获取后如果更好的把这鼠标坐标的参数值,提交到我的后台里
    比如我的A页面,上面的代码,就是放在我的A的页面里,我如果把A页面的所产生的所有坐标数据,提交到我的后台里,有什么好的方法,能否交交我