2010-10-23 66 views
1

它往往是通过代码实现这样的:是否可以防止iframe内容使用js转义到主页面?

if (window.parent.frames.length>0) {} // check how many frames, if none do nothing 
else { 
    window.location="[new destination]"; // else change the current location 
} 

但我想阻止iframe中的内容从知道它是在iframe中。 我正在写一个php代理,内容将来自同一个域,我知道我有一个选项可以使用服务器端代码逐个删除转义代码的实例,但也许有一个选项可以在js中执行。

回答

相关问题