gpt4 book ai didi

cordova - addEventListener方法最后的true和false是什么意思

转载 作者:行者123 更新时间:2023-12-01 16:00:35 24 4
gpt4 key购买 nike

这是 Phonegap addEventListener 方法的示例

document.addEventListener("deviceready", onDeviceReady, false);

任何人都可以向我解释什么是假的,或者有时最后是真的。

还有一件事..

navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);

上面的例子说,如果他成功获得当前加速度,则触发 onSuccess 函数,如果没有则触发 onError 函数……对吗?我对加速示例的看法是否正确,请向我解释 addEventListener false 和 true 的含义,非常感谢。

最佳答案

在提问之前谷歌搜索时,您会惊讶地发现...

useCapture Optional
If true, useCapture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. Events which are bubbling upward through the tree will not trigger a listener designated to use capture. See DOM Level 3 Events for a detailed explanation. If not specified, useCapture defaults to false. Note: useCapture became optional only in more recent versions of the major browsers; for example, it was not optional prior to Firefox 6. You should provide this parameter for broadest compatibility.

developer.mozilla.org documentation

Required. Boolean that specifies whether the event needs to be captured or not.

Full documentation

关于cordova - addEventListener方法最后的true和false是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20299856/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com