問題描述
我正在嘗試在 iframe 中打開谷歌搜索.它一直工作到最近,但發(fā)生了一些事情.
i am trying to open a google search inside an iframe. it was working until recently but something happened.
這可以在這里測(cè)試:http://jsfiddle.net/patrioticcow/xTjyX/
我還在鏈接的末尾添加了 &output=embed
,但看起來沒有幫助.
i also added &output=embed
at the end of the link, but it looks like it doesn't help.
在 chrome 中我得到:拒絕顯示文檔,因?yàn)?X-Frame-Options 禁止顯示.
但它也不適用于 Mozilla.
in chrome i get: Refused to display document because display forbidden by X-Frame-Options.
but it doesn't work in Mozilla also.
有什么想法嗎?
謝謝
推薦答案
X-Frame 選項(xiàng)是由您嘗試嵌入 iframe 的頁面的網(wǎng)絡(luò)服務(wù)器發(fā)送的標(biāo)頭.它基本上告訴瀏覽器不允許將頁面嵌入到 iframe 中.看看 https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header 更詳細(xì)的描述.
The X-Frame option is a header sent by the webserver of the page you are trying to embed into the iframe. It basically tells the browser not to allow embedding the page in an iframe. Have a look at https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header for a more detailed description.
顯然,Google 不希望您將其搜索結(jié)果嵌入到 iframe 中.
Obviously Google does not want you to embed it's search results into an iframe.
這篇關(guān)于如何在 iframe 中打開谷歌鏈接?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!