Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html event.returnValue在iframe中已弃用_Html_Css_Iframe - Fatal编程技术网

Html event.returnValue在iframe中已弃用

Html event.returnValue在iframe中已弃用,html,css,iframe,Html,Css,Iframe,我已经编写了一个iframe来嵌入我的网站,但是我经常收到这样的警告:“event.returnValue已被弃用。请改用标准event.preventDefault() 我在网上看过,但是没有人提到iFrame有任何问题。有人知道为什么它会警告事件被弃用吗 我的代码是: <iframe width="984" height="558" frameBorder="0" src="https://www.youtube.com/watch?v=uHfWtA7AsHI"></ifr

我已经编写了一个iframe来嵌入我的网站,但是我经常收到这样的警告:“event.returnValue已被弃用。请改用标准event.preventDefault()

我在网上看过,但是没有人提到iFrame有任何问题。有人知道为什么它会警告事件被弃用吗

我的代码是:

<iframe width="984" height="558" frameBorder="0" src="https://www.youtube.com/watch?v=uHfWtA7AsHI"></iframe>


视频显示良好,但当我检查页面上的错误时,我得到了警告。如果删除iframe,错误就会消失。

错误出现在YouTube上。这不是一个错误,只是一个警告。在chrome内部,如果您执行任何鼠标事件,即使您不返回值,也会出现该错误。这是一个内置函数,Chrome使用它来实现其他一些功能。这与iframe无关,但与iframe加载的页面有关。显然,Youtube在某处使用了
event.returnValue
。没什么好担心的。另见。