2009-02-04 24 views

回答

9

你可以试试这个。让我知道它是如何工作的。

var myIframe = document.getElementById('myIframeId'); 

// could retrieve window or document depending on the browser 
// (if FBJS allows it!?) 
var myIframeWin = myIframe.contentWindow || myIframe.contentDocument; 

if(!myIframeWin.document) { //we've found the document 
    myIframeWin = myIframeWin.getParentNode(); //FBJS version of parentNode 
} 
0

浏览器上的Same Origin Policy

原则处理域安全性和laws of cross domain communication

而且你会发现在读写JS的API对这个博客的creationg一个有趣的阅读后http://piecesofrakesh.blogspot.com/2007/11/how-to-build-readwrite-javascript-api.html

+0

这个问题不涉及跨域脚本。这些脚本被注入Facebook的域中,这是iframe元素所在的同一个域。 Facebook已更改底层原型以防止访问。 – thesmart 2010-02-26 00:59:11

相关问题