Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Need help with coordinate capturing


ghost's Avatar
0 0

Hey, I'm trying to write a script that will capture the coordinates that the user clicked on, then alert the coords.

Can someone give me a hand in this? Google hasn't brought me anything that works yet.


ghost's Avatar
0 0

what language?


ghost's Avatar
0 0

Javascript or PHP, whatever is easiest.


ghost's Avatar
0 0

uhh, anyone?


ghost's Avatar
0 0
var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;
function getMousePosition(e) {
  var _x;
  var _y;
  if (!isIE) {
    _x = e.pageX;
    _y = e.pageY;
  }
  if (isIE) {
    _x = event.clientX + document.body.scrollLeft;
    _y = event.clientY + document.body.scrollTop;
  }
  document.exf1.x.value=_x;
  document.exf1.y.value=_y;
  return true;
}
</script>```

i found that. didnt write it. looks like what you want tho. if you need more help pm me and we'll go over other stuff

ghost's Avatar
0 0

thanks guys, i got it working now.