Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found

夙愿已清 提交于 2019-12-10 17:15:03

问题


hi there i am a student and practicing how to place the like box plugging code in simple html using the notepad, here is the simple code i write with the like box plugging code:

<html>
    <head>
      <title>My Great Web page</title>
    </head>
    <body>
<iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Febitesblog&amp;width=292&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;stream=true&amp;header=true&amp;height=590" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:590px;" allowTransparency="true"></iframe>
    </body>
 </html>

and when i try to execute in browser it says: This webpage is not found No webpage was found for the web address:

file://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Febitesblog&width=292&colorscheme=light&show_faces=true&border_color&stream=true&header=true&height=590
Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found

hope guys it will fix my problem thank you :)


回答1:


It's failing because the // in that is protocol relative meaning it loads the link/photo/like box/whatever using the same protocol used to access the page itself.

  • When accessing the page over HTTP (http://), the Like Box will be included over HTTP
  • When accessing the page over HTTPS (https://), the Like Box will be included over HTTPS

You're accessing a file on localhost, via the file protocol (file://) - which means it tries to include the Like box the same way, which is not valid since there isn't a file on your machine called 'www.facebook.com`

Use <iframe src="https://... now, and change it back to <ifame src=//... when you're uploading to your server




回答2:


<iframe src="//www.facebook.com/plugins/likebox...

should be...

<iframe src="https://www.facebook.com/plugins/likebox...


来源:https://stackoverflow.com/questions/7852850/error-6-neterr-file-not-found-the-file-or-directory-could-not-be-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!