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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:17:23+00:00 2026-06-14T05:17:23+00:00

I have a page on a domain: http://main.mydomain.com/frame.cfm which holds an iframe, loading a

  • 0

I have a page on a domain:

http://main.mydomain.com/frame.cfm which holds an iframe,
loading a domain http://www.anotherdomain.com.

This page http://www.anotherdomain.com has a script reference to http://sub.mydomain.com/somescript.js

This somescript is a tracking script like google Analytics, which loads with each request of http://www.anotherdomain.com.

At a certain stage, the script http://sub.mydomain.com/somescript.js in the page http://www.anotherdomain.com will try to call window.top.aFunction(); or parent.aFunction();

to make the parent window do something.

I know about the X-Frame-Options and the Access-Control-Allow-Origin header and tried both, but still when I browse in my iframe on http://www.anotherdomain.com I get a error message in Firebug telling me:

Error: Permission denied to access property 'relocate'window.top.aFunction();

In my web.config on the main.domain site i have the following rules:

<httpProtocol>
     <customHeaders>
    <add name="Access-Control-Allow-Origin" value="http://sub.mydomain.com" />
        <add name="X-Frame-Options" value="ALLOW-FROM http://sub.mydomain.com" />
     </customHeaders>
</httpProtocol>

Which in my opinion should grant the sub.mydomain.com access to the script on main.mydomain.com.

I am testing this with all the domains except the http://www.anotherdomain.com locally on my pc with host reference in place.

Any idea what I am missing here?

  • 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-14T05:17:24+00:00Added an answer on June 14, 2026 at 5:17 am

    You can’t access the parent window function’s methods through a cross domain iFrame. It goes against the Same Origin Policy . The X-Frame http header response tells the browser whether it is allowed to render a page in the iFrame and does not help your situation.

    The solution I recommend is to use window.postMessage() to communicate between the two frames. Look at http://ejohn.org/blog/cross-window-messaging/

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

Sidebar

Related Questions

I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
My question is quite simple. I have my main page (www.domain.com/index.php) Is there a
Hi I have a main domain as follows Main domain : http://www.sample.com/ Sub domain
I have paginated URLs that look like http://www.domain.com/tag/apple/page/1/ If a URL such as http://www.domain.com/tag/apple/page/*2/
I have a page, URI looks like this: http://domain.example.com/Profiles/Profile.aspx?username=blah#blahtab When that fragment (#blahtab) is
Hi guys I have this code that checks linkback: $reciprocal_linkback = reciprocal_linkback($contenturl,http://www.mydomain.com,1); if ($reciprocal_linkback==0)
Currently have a database formatted as follows: id (unique id) url: http://domain.com/page.html Urls are
I have a payment page on my website: domain.com/user/payment/product_name and I want to be
I have an iframe in the same domain as the web page. I have
I have a route like following, ideally I would like it to match: domain.com/layout/1-slug-is-the-name-of-the-page

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.