87,903
社区成员
发帖
与我相关
我的任务
分享
<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>
<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>