0

我正在编写纯 HTML 和 CSS,并从本地硬盘驱动器直接在浏览器中加载文件。

FancyBox 2 正在加载灯箱效果,所以我知道脚本正在运行,但在尝试播放视频时收到以下错误消息:

"This webpage is not found
No webpage was found for the web address: file://player.vimeo.com/video/25634903?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1
Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found."

file://请注意,即使我指定的 HREF URL是,脚本仍试图从中加载视频HTTP://vimeo/25634903

然后我在本地浏览器中加载了演示文件,尝试播放 youtube 和 vimeo 视频示例,我收到了同样的错误。该演示确实可以正确加载图像,但不能正确加载视频。

我可以在 fancBox js 文件中进行一些调整以允许我在本地使用它吗?谢谢!

4

1 回答 1

1

If you simply open a html file in the browser it load the file with file:// scheme. Most good scripts are designed to use protocol relative URLs, by giving urls as //<url>. For eg, if the page is loaded as https scheme, it automatically loads https://<url>.

That is one of the reasons why it is always a good idea to test java script/html on a real web server instead of opening the file directly.

Also, some browsers with no-script or similar plugins disable certain js functionality for scripts loaded as file://

于 2012-07-19T21:42:46.710 回答