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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:22:33+00:00 2026-05-11T16:22:33+00:00

I have a .jsp that contains an IFrame with a page that has some

  • 0

I have a .jsp that contains an IFrame with a page that has some embedded JavaScript. This JavaScript accesses some DOM elements in the parent page (the one containing the IFrame).

The embedded page is going to be on a seperate sub-domain from the parent page, and I realize that there are some security implications. My impression is that the document.domain of any pages embedded in IFrames must match the document.domain of parent pages for cross-IFrame access to be allowed. The embedded page currently contains the following code to broaden the scope of its security:

document.domain = 'domain.com'; //where domain.com is my domain

It then proceeds to access DOM elements in the parent document.

I am currently testing this, and have modified the hosts file on the Windows machine serving the parent page with the following entry:

127.0.0.1 domain.com

The goal is to trick JavaScript on the parent page into believing that the document in the embedded page is being served from the same domain.

If I then browse to the page on the same machine. Despite the document.domain showing up as domain.com in both my parent and embedded pages as observed through Firebug, I am getting ‘Permission denied’ errors when attempting to get or set DOM properties from JavaScript running in the embedded page.

Am I missing something?

  • 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-11T16:22:33+00:00Added an answer on May 11, 2026 at 4:22 pm

    Even though the “document.domain” properties look the same, from the MSDN documentation is sounds like you still have to explicity set them to be the same:

    All the pages on different hosts must
    have the domain property explicitly
    set to the same value to communicate
    successfully with each other. For
    example, the value of the domain
    property of a page on the host
    microsoft.com is “microsoft.com” by
    default. It might seem logical that if
    you set the domain property of a page
    on another host named
    msdn.microsoft.com to “microsoft.com,”
    that the two pages could communicate
    with each other. However, this is not
    the case, unless you explicitly set
    the domain property of the page on
    microsoft.com to “microsoft.com.”

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

Sidebar

Related Questions

I have a welcome page (JSP file) for my application that contains some dynamic
Right now I have a JSP page that allows to sort some items, when
I have jsp page that contains <span class=requiredFieldsMessageAsterix>*</span> I use a jsp include to
I have a form JSP web page, this form contains multiple instances of the
I have written a small JSP page that contains a text box and a
I have a JSP that contains the content at the top of my page,
I have a web page (SSL) that contains a barely visible iframe whose source
I have JSP page that contains table. when I click on one row of
I have a jsp file that contains this code, <form id=testForm> <input type=hidden value=study--study
I have a page that has a form backing object that contains a collections

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.