Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:35:38+00:00 2026-05-26T08:35:38+00:00

I have an iframe in a document from a different domain. It seems the

  • 0

I have an iframe in a document from a different domain. It seems the browser blocks me to access the inner iframe for this reason. Can I change both domain to the same value? I tried document.domain = 'targetdomain', but there is DOM exception thrown out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:35:38+00:00Added an answer on May 26, 2026 at 8:35 am

    The domain of the iframe is the domain of the URL that loaded into the iframe.

    You can change the iframe.src to a different document if you like on a different domain, but you cannot change the domain of the iframe itself while keeping the same document loaded in order to enable you to access the content as that would be the very security violation that the same-origin policy protects from.

    The one exception to changing the domain is when using sub-domains. You can read about that here.

    So, unless one of these two domains is a sub-domain of the other, you cannot access one from the other.

    In the latest browsers, there is an HTML5 message passing scheme that allows two cooperating frames/windows from different domains to exchange messages with each other. The key here is that both frames/windows must cooperate for this to happen (meaning you must have code control over both frames/windows). You can read more about that here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iframe window that displays a report. To access this iframe, I
I have seen some elegant solutions on fetching the parents document from iframe -
I have iframe (cross domain) with src from Facebook, Twitter or etc. I need
I have an iframe that returns data to the top.document window just fine by
I have a iframe that i want to open pdf's into from a list
Okay, I have a page on and on this page I have an iframe.
I have two iframes ( iframe1 and iframe2 ) from the same domain, which
Basically I have an iframe loaded that is accessed from the parent whenever it
I have a page we can call parent.php . In this page I have
I have this piece of HTML: <div class=embed> <iframe width=300 height=200 frameborder=0 allowfullscreen= src=http://www.youtube.com/embed/123456></iframe>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.