当HTML中的文件不可用时执行脚本?

王林
王林 转载
2023-09-19 21:37:02 233浏览

当HTML中的文件不可用时执行脚本?

当文件在 HTML 中不可用或为空时,使用 HTML 中的 onemptied 属性来执行脚本。

<!DOCTYPE HTML> <html> <body> <video width = "300" height = "200" controls onemptied ="display()"> <source src = "/html5/foo.ogg" type = "video/ogg" /> Your browser does not support the video element. </video> <script> function display() { alert ("Sorry! Empty playlist!"); } </script> </body> </html>

以上就是当HTML中的文件不可用时执行脚本?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除