Deprecated: Function create_function() is deprecated in /var/www/vhosts/eduardoarellano.com/d4mations.com/wp-content/plugins/wp-automatic/wp-automatic.php on line 70
Accessing an iframe document (contentWindow) – JavaScript Tutorial | D4mations.com
  • Saturday , 24 October 2020

Accessing an iframe document (contentWindow) – JavaScript Tutorial

Code Canyon



In this video we take a look at the contentWindow and contentDocument properties of an embedded iframe – it allows access to the underlying “window” and “document” objects of the HTML page.

Support me on Patreon:
https://www.patreon.com/dcode – with enough funding I plan to develop a website of some sort with a new developer experience!

For your reference, check this out:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow

Follow me on Twitter @dcode!

If this video helped you out and you’d like to see more, make sure to leave a like and subscribe to dcode!

Original source

3d Ocean

Related Posts

10 Comments

  1. Rooibo Quallity
    February 3, 2020 at 17:20

    Can you post the source code somewhere?

  2. vico vd eventuin
    February 3, 2020 at 17:20

    Thanks! Is it also possible to pause and start an embedded video from youtube that is running in an iFrame?

  3. vicente de vedia
    February 3, 2020 at 17:20

    Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.

    i get this error when i do a console.log(myIframe)

  4. vicente de vedia
    February 3, 2020 at 17:20

    Hello, tnx for this video is very helpful. I just want to ask if is possible to do the same staff but with the button inside the iframe? for example i want to push the button and then close the do a z-index in order to hidde it.

    Kind regards.

  5. Heat Visuals
    February 3, 2020 at 17:20

    I like the typing sound effects. Sounds real af

  6. kush kumar
    February 3, 2020 at 17:20

    I am getting below error while accessing the iframe with its id
    SecurityError: Permission denied to access property "document" on cross-origin object

  7. satish ganai
    February 3, 2020 at 17:20

    how to access cross-origin external website like google.com inside iframe. I am getting cross-origin error. Please help

  8. manjinder singh
    February 3, 2020 at 17:20

    Best one I found

  9. Imran Shaikh
    February 3, 2020 at 17:20

    Thanks it’s very helpful

  10. Bikram Chettri
    February 3, 2020 at 17:20

    Can you show how to use scrollHeight properties of an element?

Leave A Comment

You must be logged in to post a comment.