onmouseover="mouseOverFunction()"
是找不到这个对象
上面只有 mouseOverFunction(e) 这个对象一个是有参数的,一个是没参数的,虽然看起来差不多,可是电脑是很严格的JS的对象就很多了,要说对象其实所有语言都差不多的原理

解决方案 »

  1.   

    这段代码是抄的书上的,把mouseOverFunction(e)改为mouseOverFunction()也不对,是不是有别的错误呢?
      

  2.   

    document.form1.textbox,不要这样用
    有时候去不到的
    还是好好的getElementById或者TagName,参数是没有关系的
    一步步试,可以找出错误来的
      

  3.   

    if(window.event.shiftKey&&window.event.ctrl)这里错了,因该是if(window.event.shiftKey && window.event.ctrl)
      

  4.   

    楼是上的,两个一样的啊,你是不是想说改为if(window.event.shiftKey  &&  window.event.ctrlKey),由于刚进来,分不多,就少分点了!但是我在这里真诚的感谢各位!
      

  5.   

    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;
             }
      }
      

  6.   

    是我说错了,楼上的说对了是ctrlKey