473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

hiding (not closing) an Iframe from self

I want to be able to hide an iframe but I need to be able to activate
this from the iframe itself.

This works most of the time but I it runs into issue when the domains
don't exactly match I get the following error in Firefox:

Error: uncaught exception: Permission denied to get propert
HTMLIFrameElement.style

I have tried:

document.defaultView.frameElement.style.display = 'none';

and

parent.document.getElementById('theIframeElement') .style.display='none';

Is there a work around?

Oct 21 '05 #1
1 4400


Nathan White wrote:
I want to be able to hide an iframe but I need to be able to activate
this from the iframe itself.

This works most of the time but I it runs into issue when the domains
don't exactly match I get the following error in Firefox:


Well if the <iframe> element is in a document loaded from a different
origin then indeed the document in the iframe can't access or manipulate
stuff in the parent document. That is the same origin policy.

The only solution the same origin policy allows is if you have e.g. one
document from host1.example.com and one from host2.example.com, then you
can set
document.domain = 'example.com'
in both documents before trying any cross document access.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Chris Sharman | last post by:
I've got 3 'alternative' boxes, only one of which I want displayed, according to the value of an earlier select (so I'm using the <htmlelement>.style property from javascript). One is a div...
13
by: Simon Wigzell | last post by:
I have developed a javascript application that can be used by my clients just by inserting the following in one of their web pages: <script> document.write('<iframe...
5
by: Ivan | last post by:
I am used to VB6 and am not sure how to do this in Vstudio .NET. I have a main form which calls other forms. I want to disable that main form while other ones are called. I tried hiding it and...
11
by: Alex | last post by:
Hello all, I have a main form(say "form1") .i want to display another form(say "form2") on occuring of an event (say a button click) and want to hide it after some time so that it will again...
7
by: Alexander Eisenhuth | last post by:
Hi all, I'm wodering how the information hiding in python is ment. As I understand there doesn't exist public / protected / private mechanism, but a '_' and '__' naming convention. As I...
0
by: Vishal Sethia | last post by:
I am trying to write a multi-threaded program and use pexpect along with it. All works fine until I try to close the connection handle. That thread keeps waiting until the connection handle closes....
1
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.