2010-11-03 83 views
1

我有域A打开一个域B的IFRAME,它打开域A的IFRAME以访问parent.parent。Safari和Chrome中的iframe问题

我能够从A做JS功能,但SAFARI & Chrome除外。

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

我能做些什么?感谢

回答

0

那只是因为你从域中B. iframe的做contentWindow得到一个你应该做的像水木清华document.getElemenetsByTagName('iframe')[0].contentDocument.getElemenetsByTagName('iframe')[0].contentWindow.location(请注意,我没有测试)

0

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