function cnvs_getCoordinates(e)
{
x=e.clientX;
y=e.clientY;
document.getElementById("xycoordinates").innerHTML="Coordinates: (" + x + "," + y + ")";
}
为什么非要传个参数,有什么好处,下面这么些有什么不同?
function cnvs_getCoordinates()
{
x=event.clientX;
y=event.clientY;
document.getElementById("xycoordinates").innerHTML="Coordinates: (" + x + "," + y + ")";
}
刚毅87
相关分类