用xmlhttp可以实现<script language="javascript">
function moddata()
{

var xml = new ActiveXObject("Microsoft.XMLHTTP");
xml.open("GET", "mod.php", false);
xml.send();
alert(xml.responseText);
xml = null;
}
</script>
<body onbeforeunload='moddata()'>
-------------------------------------------------
在mod.php中执行你的修改的操作,如果想传递参数到mod.php可以将改为类似下面的
xml.open("GET", "mod.php?id=1&name=aaa", false);