这个问题专门针对本地主机。我试图将一个localhost网页嵌入另一个localhost网页,但是它指出无法完成。这是chrome开发人员工具中的消息:
Refused to display 'http://127.0.0.1:4040/jobs/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
我尝试同时使用Firefox和chrome。这是来自firefox的错误消息:
Load denied by X-Frame-Options: “SAMEORIGIN” from “http://127.0.0.1:4040/jobs/”,site does not permit cross-origin framing from “http://localhost:8888/lab”.
为什么不将localhost视为同一来源?
如何取消对本地主机的限制?
先谢谢您。
我宁愿在AJAX请求上使用iframe,除非AJAX能够以iframe能够执行的相同方式在网页上进行复制。