I have a script that moves around a div onKeyDown, and always saves the change to an XML file using PHP's asXML.
However, it seems that it only saves the last change made before you move away from the page (by refreshing for example). But I want the changes to be visible in real-time, so I need it to immediately update every time it is called.
Is this possible?
EDIT: Here's some code
In a javascript file that's called onKeyDown:
$("#savexml").load("j_edit.php?left="+leftpos+"&top="+toppos);
Which loads an AJAX file that stores a new XML file under $newxml and then saves it.
$success = $newxml->asXML('file.xml');
Again, this all works, but ONLY as I move away from the page (by refreshing or so). If it loads that php files through ajax multiple times, only the last time it will be saved.