如何識別網頁是在iframe中加載仍是直接加載到瀏覽器窗口中?

問題:

I am writing an iframe based facebook app. 我正在寫一個基於iframe的Facebook應用程序。 Now I want to use the same html page to render the normal website as well as the canvas page within facebook. 如今,我想使用相同的html頁面來呈現普通網站以及facebook中的畫布頁面。 I want to know if I can determine whether the page has been loaded inside the iframe or directly in the browser? 我想知道是否能夠肯定頁面是否已在iframe中加載或直接在瀏覽器中加載? html


解決方案:

參考一: https://stackoom.com/question/1MpB/如何識別網頁是在iframe中加載仍是直接加載到瀏覽器窗口中
參考二: https://oldbug.net/q/1MpB/How-to-identify-if-a-webpage-is-being-loaded-inside-an-iframe-or-directly-into-the-browser-window
相關文章
相關標籤/搜索