code_junkie

Is there a way to access an iframe's window object from the canvas in FBJS (facebook)

Nov 14th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var myIframe = document.getElementById('myIframeId');
  2.  
  3. // could retrieve window or document depending on the browser
  4. // (if FBJS allows it!?)
  5. var myIframeWin = myIframe.contentWindow || myIframe.contentDocument;
  6.  
  7. if( !myIframeWin.document ) { //we've found the document
  8. myIframeWin = myIframeWin.getParentNode(); //FBJS version of parentNode
  9. }
Add Comment
Please, Sign In to add comment