event.offsetX, event.offsetY,可以参考一下下面的链接。
http://www.w3school.com.cn/htmldom/dom_obj_event.asp

解决方案 »

  1.   

    FF会在事件里传给你一个参数e,跟window.event差不多的用法
      

  2.   


    <html>
    <head>
    <script type="text/javascript">
    showPosition(e) {
      if(!document.all) {    //如果是非ie浏览器
        alert("x:"+e.pageX+"  y:"+e.pageY);
      }
    }
    </script>
    </head>
    <body onclick="showPosition(event);">    <!--必须传入一个event对象-->
    </body>
    </html>
    顺手写的, 没有试过, 我机器上的firefox被禁用了.
      

  3.   

    bug 修正:
    <html>
    <head>
    <script type="text/javascript">
    function showPosition(e) {    //shit, 我竟然忘了加"function", 这回人丢大了!
      if(!document.all) {    //如果是非ie浏览器
        alert("x:"+e.pageX+"  y:"+e.pageY);
      }
    }
    </script>
    </head>
    <body onclick="showPosition(event);">    <!--必须传入一个event对象-->
    </body>
    </html>