473,387 Members | 1,374 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,387 software developers and data experts.

Can action in an iframe change look and feel of the containing HTML?

I have a HTML file that contains an iframe. The HTML file is served
by one server. The iframe contains a link to a completely different
server. My question is, can any action in the iframe (such as a form
submit) cause the look and feel of the containing HTML to change, such
as I want some table elements in the parent (that contains the iframe)
to change or disappear.

For example, a HTML file has a table with 3 rows, the first and last
row each has an element which has text "row 1" and "row 3"
respectively. The second row contains an iframe which has a link
served by a different server. When the page load, the iframe displays
a form with one text field and one submit button. When user enters a
text string such as "jessey" in the text field and clicks the button.
The text in the first row element of the parent page changes to
"jessey" and text in the last row element of the parent page
disappears.

How should I do it if it is possible? Are there any examples that I
can start with?

Thanks a lot for help.
jessey
Jul 20 '05 #1
2 3068


google@wa wrote:
I have a HTML file that contains an iframe. The HTML file is served
by one server. The iframe contains a link to a completely different
server. My question is, can any action in the iframe (such as a form
submit) cause the look and feel of the containing HTML to change, such
as I want some table elements in the parent (that contains the iframe)
to change or disappear.

For example, a HTML file has a table with 3 rows, the first and last
row each has an element which has text "row 1" and "row 3"
respectively. The second row contains an iframe which has a link
served by a different server. When the page load, the iframe displays
a form with one text field and one submit button. When user enters a
text string such as "jessey" in the text field and clicks the button.
The text in the first row element of the parent page changes to
"jessey" and text in the last row element of the parent page
disappears.

How should I do it if it is possible? Are there any examples that I
can start with?


If the iframe contains pages from a different domain then client side
script due to the same origin policy cannot change the content of the
document in the containing window.
If the servers are different but in the same domain e.g.
host1.example.com and host2.example.com then you can set
document.domain = 'example.com';
in script and you should be able to script one document from the other
e.g. with
parent.document
from inside the iframe you reach the document of the containing window
or frame.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
On 13 Jan 2004 00:25:21 -0800, je*******@yahoo.com (google@wa) wrote:
I have a HTML file that contains an iframe. The HTML file is served
by one server. The iframe contains a link to a completely different
server.


This is not possible in a default security environment.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #3

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

Similar topics

3
by: Dany P. Wu | last post by:
Hi everyone, I am trying to create a site with pages containing iframes. This is the first time I've used inline frames and am still struggling with the concept. This site will have 10 pages...
2
by: google | last post by:
I have a HTML file that contains an iframe. The HTML file is served by one server. The iframe contains a link to a completely different server. My question is, can any action in the iframe (such...
24
by: ej1002 | last post by:
Hi I have developed a Windows Application(C# Windows Form) which will get the IFrame Source of the page it is navigating using Webbrowser Control. Now I want do this in ASP.Net web application(C#...
5
by: Chris Kennedy | last post by:
I want to put an Iframe on a webform page. How do I get the Iframe's source file to change at the press of button control on a web form (containing the iframe). Preferabaly without javascript,...
13
by: Fernando Deutsch | last post by:
I have an html page with an iframe on it. Inside the iframe there is an img element. I am looking how to reference the iframe from the img element contained on it and cannot find a way to do it. I...
3
by: jkeel | last post by:
Here's what I'm trying to do (any opinions whether this is OK or plan stupid are appreciated): I have a parent web page that will contain a Page Title at the top and a save and probably a cancel...
10
by: jon | last post by:
I'm trying to use a hidden iframe to print the contents of one div seamlessly. Currently I can create the hidden iframe, copy the contents of the div to the iframe, and print it. I even have a...
3
by: synergy_711 | last post by:
I feel like this should be fairly easy but I have been struggling with this for sometime. I have not been able to find someone who's had the same problem as mine yet. ...
1
by: CJ4R | last post by:
Have an issue with an iframe in FF blocking links in a z-index layer behind the layer containing the iframe. It works in IE. I can't change the layer index of the iframe because it's content needs to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.