Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法知道页面是否被 iframed 了?
我在想类似的东西if (window.parent),但这显然是不对的。
if (window.parent)
任何人都可以帮忙吗?
if (window!=window.top) { /* I'm in a frame! */ }