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

The Archive Base Latest Questions

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

I have seen some elegant solutions on fetching the parents document from iframe –

  • 0

I have seen some elegant solutions on fetching the parents document from iframe – like e.g. this one. However, I can’t make it work – and I didn’t think this was possible due to securities issues (cross domain scripting?)?

My question is; can I still access the parents document from inside an iframe – or has this changed the recent years? If I should be able to access this; any thoughts on why I get undefined when printing parent.document or window.parent.document from the content of the iframe?

  • 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-26T18:38:48+00:00Added an answer on May 26, 2026 at 6:38 pm

    It’s still possible to access the parent from within a frame provided that the domains match.

    For example, have a look at these fiddles:

    • Frame host: fiddle.jshell.net, parent host: fiddle.net Does not match = failure
      Test #1: http://jsfiddle.net/nrRQg/1/
    • Frame host: jsfiddle.net, parent host: jsfiddle.net **Matches = success*
      Test #2: http://jsfiddle.net/nrRQg/1/show/

    You can access the parent through:

    window.parent
    parent
    top          //If the parent is the top-level document
    window.top
    

    The variables parent and top can be overwritten (usually not intended). It’s safer to use window.parent to be more safe. Alternatively, you can replace window by document.defaultView.

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

Sidebar

Related Questions

I have seen some other posts on how to get this working ... however
I have seen some code do this: if(something){ echo 'exit from program'; die; }
i have seen some hand rolled solutions but does jquery out of the box
I have seen some form of this some time ago, but I cannot recall
I have seen some ListView dynamic growing implementations which use OnScrollListener. I would like
I have seen some solutions on how to use a dropdown list in HTML
I have seen some code that removes a given layer from it's superlayer by
Have seen some conversations revolving around this, but hoping for some current input as
I have seen some answers to this but I think I am actually having
I have seen some other questions about this, but none of the answers really

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.