Safari中的iframe问题&铬

时间:2010-11-03 19:55:18

标签: javascript iframe google-chrome safari xss

我有域A打开带域B的IFRAME,它打开带有域A的IFRAME以访问parent.parent。

我可以从A做JS功能,SAFARI&铬。

我有iframe DOM元素,我做iframe.contentWindow.location但是它没有给我正确的域名! (给我域B)

我能做什么?感谢

2 个答案:

答案 0 :(得分:0)

这只是因为你为来自域B的iframe做了contentWindow。要获得A,你应该像document.getElemenetsByTagName('iframe')[0].contentDocument.getElemenetsByTagName('iframe')[0].contentWindow.location那样做(注意我没有测试它)

答案 1 :(得分:0)

问题是,iframe需要在运行时打开而不是在HTML中打开。 (iframe +运行时的src)

相关问题