By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,819 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a


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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.