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 9248655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:59:32+00:00 2026-06-18T09:59:32+00:00

I have done some research on this and what i found was in same

  • 0

I have done some research on this and what i found was in same domain’s case you can use

document.getElementById('iframe_id').contentWindow.function_name()

I tried this on cross-domain (just experimenting)
It gave a cross domain error &

Exception: TypeError: Property ‘function_name’ of object [object Window] is not a function

So I have a three part question

a) It is understandable if I have trouble accessing parent from child (and I am already handling this, using another iframe(from parent’s domain) within child iframe).
But why do we have issue accessing child from parent, isn’t that the same thing as having a

b) When I debug, using the chrome inspector tool & try to see the value of document.getElementById('iframe_id').contentWindow, I see my function_name under it, but cannot access it by document.getElementById('iframe_id').contentWindow.function_name(). Why is that?

c) How do I successfully call a javascript function in my iframe from the parent(without easyXDM or any other plugin)?

More details:
I am more of looking for two way communication as in, my parent will call a function in iframe that returns a result & based on that result the parent will decide if it wants to redirect or not

  • 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-06-18T09:59:34+00:00Added an answer on June 18, 2026 at 9:59 am

    I used postMessage. Seemed like a simpler solution.

    What I wanted to do:
    ‘beforeunload’, send a message to child iframe, receive a response as callback. based on response show message or navigate.

    But this was not possible.

    This is how I solved it:

    Every time a change was made in my child frame, I sent a message to the parent.
    I collected these messages & used them on ‘beforeunload’ to decide if i should navigate or show the message

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

Sidebar

Related Questions

I have done some research and found that I can use: string retUrl =
I have done some research, and majority of the examples I have found use
Have done some research into this topic, but found no relevant answers. What I
So I have done some research, and have found you can create a boost::thread
This should be quite easy, and I have done some research on this. I
Ok I am still learning this... I have Googled and done some research but
Have done some research and found some stuff that may be helpful. I would
I have done some research on the above and found that I am able
I have done some looking and I found this: http://www.codeproject.com/Articles/14439/The-ScrollableListBox-Custom-Control-for-ASP-NET-2 but to me it
I've done some research on this problem and have seen a handful of possible

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.