How do I use (vb coding) to write the X Y mouse position coordinates to a server-side textfile?

I want to write the mouse position coordinates to a text file on the server as users move the cursor around. I would like to do this about 5-10 times per second via some type of appending-a-textfile method or perhaps store them in a hidden field (e.g. a hidden listbox etc) and then write them all at once to the server-side file. Anyone know how I can accomplish this? Many thanks.....

Who is Participating?
CoyotesITConnect With a Mentor Commented:
This will capture the xy of the mouse onmove and will put the values in a textarea
<script language="javascript">
	function getXY()
		var t = document.getElementById("mousexy");
		var x = window.event.clientX;
		var y = window.event.clientY;
		var xy = "X: " + x + ", Y: " + y + "\n";
		t.value = t.value + xy;
<body onmousemove="getXY()">
<textarea id="mousexy" type="text" style="height:300px; width:400px;"></textarea>

Open in new window

jazjefAuthor Commented:
One note, use

pageX, pageY for Firefox.

if that is a concern.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.