onmouseover="mouseOverFunction()" 是找不到这个对象 上面只有 mouseOverFunction(e) 这个对象一个是有参数的,一个是没参数的,虽然看起来差不多,可是电脑是很严格的JS的对象就很多了,要说对象其实所有语言都差不多的原理 ---------------------------------------------------- 乱讲 mouseOverFunction(e)的e有时候可以捕捉到事件对象,只是楼主的代码没用的 ----------------------------------------------------- if(window.event.shiftKey&&window.event.ctrl)这里错了,因该是if(window.event.shiftKey && window.event.ctrl) ------------------------------------------------------- 没话讲了,5个裤衩也不知道哪里捡来的 -----------------------------------------------------楼主的问题其实是因为没有event.ctrl 所以这段函数应该是 function mouseOverFunction(e) { e = e || window.event; if(window.event.shiftKey&&window.event.ctrlKey) { document.form1.textbox.value="shif and ctrl keys down and mous over at :"+e.x+"'"+e.y; return; } }
有时候去不到的
还是好好的getElementById或者TagName,参数是没有关系的
一步步试,可以找出错误来的
是找不到这个对象
上面只有 mouseOverFunction(e) 这个对象一个是有参数的,一个是没参数的,虽然看起来差不多,可是电脑是很严格的JS的对象就很多了,要说对象其实所有语言都差不多的原理
----------------------------------------------------
乱讲
mouseOverFunction(e)的e有时候可以捕捉到事件对象,只是楼主的代码没用的
-----------------------------------------------------
if(window.event.shiftKey&&window.event.ctrl)这里错了,因该是if(window.event.shiftKey && window.event.ctrl)
-------------------------------------------------------
没话讲了,5个裤衩也不知道哪里捡来的
-----------------------------------------------------楼主的问题其实是因为没有event.ctrl
所以这段函数应该是
function mouseOverFunction(e)
{
e = e || window.event;
if(window.event.shiftKey&&window.event.ctrlKey)
{
document.form1.textbox.value="shif and ctrl keys down and mous over at :"+e.x+"'"+e.y;
return;
}
}