Skip to content

Instantly share code, notes, and snippets.

@gf3
Created July 13, 2009 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gf3/146218 to your computer and use it in GitHub Desktop.
Save gf3/146218 to your computer and use it in GitHub Desktop.
Get the iframe document object
// How to get the iframe document object
// Assume 'iframe' is a variable to the iframe DOM element
var iframe_document = null;
if (iframe.contentDocument) iframe_document = iframe.contentDocument;
else if (iframe.contentWindow) iframe_document = iframe.contentWindow.document;
else if (iframe.document) iframe_document = iframe.document;
else throw(new Error("Cannot access iframe document."));
@mathiasbynens
Copy link

If you’re using jQuery: $('iframe').contents(); (Hat tip: Ben Alman)

@miketaylr
Copy link

If you're using a TI-83 Scientific Calculator you can press 2nd VARS. I think.

@akahn
Copy link

akahn commented Jun 16, 2010

TI-83 is a graphing calculator, doophus.

P.S. I have a really great Dope Wars for it if you want. Let me know if you need to borrow my cable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment