Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- From: Dr J R Stockton <reply0936@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 4 Sep 2009 23:42:27 +0100
In comp.lang.javascript message <h7qero$3m5$1@xxxxxxxxxxxxx
september.org>, Fri, 4 Sep 2009 00:15:59, Garrett Smith
<dhtmlkitchen@xxxxxxxxx> posted:
Dr J R Stockton wrote:
In comp.lang.javascript message <h7ifk3$av2$1@xxxxxxxxxxxxx
september.org>, Mon, 31 Aug 2009 23:39:57, Garrett Smith
<dhtmlkitchen@xxxxxxxxx> posted:
I've redrafted the entire entry. I found much more questions andWould it not be better to cover both frames and iframes?
discussion in the archives regarding iframes than frameset, so I
changed the question. Here is the draft:
| 9.2 How do I access an iframe's content?
IFRAME is much more common for the past five years or so. I think it is
the more important case to cover.
Sholdn't be too complicated to cover both IFRAME and FRAMESET.
Draft:-
========================================================================
| 9.2 How do I access a frame's content?
|
| To reference another frame on the same domain:
|
| A frame's content window can be found from the frames collection.
|
| Example:
|
| var fwin;
| fwin = self.frames[0]; // or:
| fwin = self.frames["iframeName"];
|
| or from the IFRAME or FRAME element:
|
| var iframeEl = document.getElementById("myFrame");
| var fwin = iframeEl.contentWindow;
|
| An identifier moomin in the the iframe's content window, is accessed
| as fwin.moomin.
|
| To communicate between frames on different domains:
| Where supported, (IE8, Firefox 3, Opera 9, Safari 4), use
| window.postMessage( message[, port], otherDomain); where supported .
You duplicated "where supported".
One should talk like that for Web authoring, since page readers may have
any JavaScript browser; only on a controlled intranet. Note
<http://en.wikipedia.org/wiki/Template:Msieshare1>. Code requiring IE
at least version 8 will not work for at least 45% of all users.
Method window.postMessage( message[, port], otherDomain) was introduced
in IE8, Firefox 3, Opera 9, Safari 4.
(if not at first release of those, need
introduction version or rephrasing)
Given that browsers without window.postMessage must be fully supported,
is there advantage to authors in adding code for that too (except where
paid by the yard)?
| Example:
In code offered to the public, one should only use for the names of
variables etc. either words that one can spell correctly or strings that
don't look like spelling mistakes.
In examples exposed to the public, good international standard English
should be used, eschewing local or populist terminology.
Please remember that work on the FAQ does not become useful until it is
published; the Web version is "Updated July 12, 2009".
I think it can be published soon. Let me know what your feedback is on this.
As has been said before, you should be generating revised sections by
and after discussion here; and, as soon as a changed version is better
than what was there before, or a new section is significantly better
than nothing, it should be posted here - if few agonised shrieks appear,
it should then immediately go into the FAQ at jibbering (which AIUI is
what Bart uses daily). You should not save things for a wildly-
different new edition.
I've updated some FAQ links at Wikipedia; could there be a way of using
Google, etc., to locate all CLJ FAQ links in Wikipedia? Including non-
English pages?? Or can Jibbering's stats identify where requests for
old-style anchors come from?
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
.
- Follow-Ups:
- References:
- Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- From: Garrett Smith
- Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- From: Dr J R Stockton
- Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- From: Garrett Smith
- Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- Prev by Date: Re: load progress bar costs £400?!
- Next by Date: FAQ Topic - How do I change print settings for window.print()? (2009-09-05)
- Previous by thread: Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- Next by thread: Re: FAQ Topic - How do I communicate between frames in a web browser? (2009-08-28)
- Index(es):
Relevant Pages
|
Loading