iframe无法在HTML中找到YouTube视频 [英] iframe can't find YouTube videos in HTML

查看:267
本文介绍了iframe无法在HTML中找到YouTube视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为一个网站设计了一个关于儿童电影的作业,我想我会把一个iframe放入YouTube视频中显示预告片。这是我使用的代码(只是带有测试视频);

For a website I am designing for an assignment about kids films and I thought I would put an iframe in to show the trailer from a YouTube video. This is the code I used (just with a test video);

<iframe width="560" height="315" src="//www.youtube.com/embed/xxMcViTf7KU" frameborder="0" allowfullscreen>This is the test iframe</iframe>

结果是页面开始加载,然后出现一个框说'没有找到文件或目录。据我所知,代码是完全正确的。我不明白有什么不对。

The result is the page begins to load, then a box comes up saying 'file or directory not found'. As far as I am aware, the code is all correct. I don't understand what's wrong.

任何帮助将不胜感激,谢谢!

Any help would be greatly appreciated, thank you!

推荐答案

不要忘记你的YouTube链接前的http://。这工作正常:

Don't forget the "http://" before your YouTube link. That's working fine:

<iframe width="560" height="315" src="http://www.youtube.com/embed/xxMcViTf7KU" frameborder="0" allowfullscreen>This is the test iframe</iframe>

这篇关于iframe无法在HTML中找到YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆