search

Home  >  Q&A  >  body text

javascript - TypeError: window.event is undefined

For click events, Firefox reported TypeError: window.event is undefined. Later I added var evt = window.event || arguments.callee.caller.arguments[0] for compatibility. Although the error was not reported, the click The event is no longer valid

三叔三叔2776 days ago1308

reply all(3)I'll reply

  • 学习ing

    学习ing2017-06-17 09:17:16

    There seems to be no writing method like $(window.event.srcElement) in jQuery. Window.event is only available in native js.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-17 09:17:16

    Owner, what does this represent? If there is no corresponding name, of course the event will be undefined

    reply
    0
  • 为情所困

    为情所困2017-06-17 09:17:16

    The person above is right, I don’t know what you $(this) want to do...

    reply
    0
  • Cancelreply