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

  • Home
  • SEARCH
  • 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 7526895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:57:43+00:00 2026-05-30T03:57:43+00:00

For say i have a Site called example.com on which iframe is embedded of

  • 0

For say i have a Site called example.com on which iframe is embedded of domain iframe.net, now i want to read the content of iframe and pass some parameter to display a textual message. Like Hi with username.

Now the problem is this able not able to make connection between the two , even am not able to get the innerHTML of iframe i used following approach

document.getElementById('myframe').contentWindow.document.body.innerHTML;

It throws error “Permission denied to access property”

Do anyone know how to read and write in cross domain platform

  • 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-30T03:57:45+00:00Added an answer on May 30, 2026 at 3:57 am

    If you don’t have control over the framed site, you cannot circumvent the cross-domain policy.

    If you have control over both sites, you can use the postMessage method to transfer data across different domains. A very basic example:

    // framed.htm:
    window.onmessage = function(event) {
        event.source.postMessage(document.body.innerHTML, event.origin);
    };
    
    // Main page:
    window.onmessage = function(event) {
        alert(event.data);
    };
    
    // Trigger:
    // <iframe id="myframe" src="framed.htm"></iframe>
    document.getElementById('myframe').contentWindow.postMessage('','*');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a site on http://example.com . I would really like allowing bots
Let's say I have a site with multiple links as follows: www.example.com/product/1 www.example.com/product/2 www.example.com/product/3
Say I have a htaccess file shared by dev.server and server.site.com. The first domain
I have a iFrame FB app (hosted on say mydomain.com) which shows the friend
Let's say I have a web site for hosting community generated content that targets
Say I have this url: http://site.example/dir/ In this folder I have these files: test.ascx.cs
I have a library called example that I'm installing into my global site-packages directory.
Say I have a website called a.com , and when a specific page of
I have obtained hosting space and they registered domain(say www.abc.com ) with an ip(say
I have a page on my site, for purposes of this example lets say

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.