473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1831


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

2
3071
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
5206
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
2475
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
4113
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
1560
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
3776
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
4966
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
1526
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
7203
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
7089
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
7282
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,...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.