我遇到了一个 javascript 错误,我无法摆脱: Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': The callback provided as parameter 2 is not an object.
这是脚本,在标签后的 cookie 同意模块中使用:
window.addEventListener("load", setTimeout( function(){
window.cookieconsent.initialise({
"palette": { "popup": {"background": "#DCDCDC"},
"button": {"background": "#9bba44"}
},
"position": "bottom-right",
"content": { "message": "We use cookies.",
"accept": "Accept all",
"deny": "Decline all",
"link": "Find out more." }
})
}, 3000));
</script>
Run Code Online (Sandbox Code Playgroud)
如果需要,我可以查看 cookieconsent.initialise,但错误可能是其他原因,对任何有经验的人来说都是微不足道的。这里的第二个参数是什么?