Basically, I have to execute a function on JS, that uses a variable in PHP. The problem I'm having is that the function on JS is executing constantly. I need the function to execute when the mouse moves over the page, which works great, except it executes in loop non-stop.
I'm pasting an example code. Any ideas on how to make it execute the JS function only once? Any help would be greatly appreaciated, I'm not very good at PHP & JS.
<?php
function page()
{
echo 'test text';
}
//page()
?>
<html>
<head>
<title>onmousemove test</title>
<script type="text/javascript">
window.onmousemove = move;
function move() {
alert("<?PHP page() ?>");
}
</script>
</head>