How can you check if your document is opened in an IFrame?

后端 未结 1 687
逝去的感伤
逝去的感伤 2021-01-02 10:38

Is there a way to know if your page is opened inside of an IFrame?

An idea I had was to see if the window object has a .parent

1条回答
  •  猫巷女王i
    2021-01-02 11:05

    if (window.top != window.self)
     {
    }
    

    0 讨论(0)
提交回复
热议问题