Home  >  Q&A  >  body text

javascript - FireFox does not support Event, does anyone know how to convert it?

I have been searching online for a long time but there is no solution

var theEvent = window.event || arguments.callee.caller.arguments[0];
var srcElement = theEvent.srcElement;

Use this kind of error, arguments ESLint: Avoid arguments.callee (no-call)
ES6 prohibits the call of arguments.callee.
Are you kidding me?
Save the great god and give me some advice! ! ! ! ! ! !

给我你的怀抱给我你的怀抱2694 days ago724

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-06-26 10:55:53

    Add event parameters in the event, for example
    <button onclick="func(e)"></button>
    var func = (e) => { alert(e || window.event ); }

    reply
    0
  • PHP中文网

    PHP中文网2017-06-26 10:55:53

    Firefox does not support event solution: http://blog.csdn.net/cyxlzzs/...

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-06-26 10:55:53

    If you are not using arrow functions, add a comment.

    /* eslint-disable */

    reply
    0
  • Cancelreply