0

我有这段代码,我在高级编译模式下通过 GCC:

window.addEventListener('popstate', function (event) { .... }

我收到这条消息:

 JSC_WRONG_ARGUMENT_COUNT: Function Window.prototype.addEventListener: called 
 with 2 argument(s). Function requires at least 3 argument(s) and no more than
 3 argument(s). at line 3601 character 0
 window.addEventListener('popstate', function (event) {

我需要在我的代码中进行哪些更改才能使其在没有警告的情况下通过?

谢谢

4

1 回答 1

1

您必须设置 addEventListener 的 useCapture 变量。

这可能是你想要的:

window.addEventListener('popstate', function(event) {...}, false);
于 2012-05-15T01:01:20.647 回答