Prev: How can I make the browser display changes at once?
Next: initializing style sheets and javascript
From: Dr J R Stockton on 25 Apr 2010 13:47 In comp.lang.javascript message <hqtbi9$2ul$1(a)news.eternal- september.org>, Fri, 23 Apr 2010 16:47:15, Garrett Smith <dhtmlkitchen(a)gmail.com> posted: >Dr J R Stockton wrote: >> In comp.lang.javascript message <hqo38s$2m7$1(a)news.eternal- >> september.org>, Wed, 21 Apr 2010 16:55:05, Garrett Smith >> <dhtmlkitchen(a)gmail.com> posted: >>> Dr J R Stockton wrote: >>>> In comp.lang.javascript message <hqjjli$4ug$1(a)news.eternal- >>>> september.org>, Tue, 20 Apr 2010 00:04:16, Garrett Smith >>>> <dhtmlkitchen(a)gmail.com> posted: >>>>> Dr J R Stockton wrote: >>>>>> In comp.lang.javascript message <4bca3d79$0$286$14726298(a)news.sunsite.dk >>>>>>> , Sat, 17 Apr 2010 23:00:02, FAQ server <javascript(a)dotinternet.be> >>>>>> posted: >>>>>> >>>>>>> FAQ Topic - How do I access a frame's content? >>>>>>> To reference another frame on the _same domain_: >>>>>> Surely one can reference the frame independently of the domain (and >>>>>> can >>>>>> use that to set its style), and it is access to the content which >>>>>> depends on the domain? If so, move that paragraph down past that to >>>>>> which it does not apply. >>>>>> >>>>> The entry is regarding the frame/window object, not an IFRAME element. >>>>> The `frames` collection answers how to do that. >>>> For the intended class of FAQ reader, an iframe is a type of frame. >>>> If >>>> the material does not apply to iframes, then "(not iframe)" is needed. >>>> >>> No, an IFRAME is an element; a `frame` is a window object. >> Again, you are thinking in terms of the standard, and not >>considering >> what ordinary people will take words to mean. You are not supposed to >> be writing merely for Thomas Lahn, David Mark, and Richard Cornford. >> >>> Can we stick to the subject and not try to classify people? >> With one exception, for the FAQ there is no need to classify >>individuals >> (exception : if there were an entry in it about Thomas). But it is >> necessary to write for the right classes of people. The most important >> class is not that of the professional Web coders, who should know it all >> already; it is that of the normal people who wish to use JavaScript on >> connection with their other work, professional or amateur. >> The exception is that a FAQ maintainer needs to be in the class of >>good >> communicators. >> >>>>>>> is accessed as ` fwin.moomin `. >>>>>> That is at best incomplete. In sitedata.htm, I use >>>>>> Ifr.style.display="block" >>>>>> FILE = Ifr.contentDocument.body >>>>>> FILE = FILE.textContent || FILE.innerText // IE8 needs latter >>>>>> and in linxchek.htm >>>>>> DOC = Fram.contentDocument >>>>>> St = DOC.body.textContent || DOC.body.innerText >>>>>> A partial FAQ answer is a misleading answer. >>>>>> >>>>> You're accessing a the window through the iframe. That is another way >>>>> to do it, and it works. >>>>> >>>>> Should the FAQ mention that approach, as well, including cross-browser >>>>> issues? It might end up being too long for an FAQ entry. >>>> If I had realised earlier what one can do with iframes in the >>>> manner >>>> above, I would have done it earlier, which would have been useful. >>>> OTOH, perhaps I could have done it with frames (though, as an element, >>>> iframe seems easier to manipulate). >>>> >>> I see it is confusing. >>> >>> An IFRAME's `contentDocument` property, or `contentWindow` property, >>> where supported, will point to, respectively, either the window or the >>> document that is loaded in that IFRAME. >> Respectively? >> > >Where supported: > contentDocument -> document > contentWindow -> window Think again. >>> That IFRAME's contentWindow can also be accessed via the `frames` >>> collection. Thus: >>> >>> document.getElementsByTagName("iframe")[0].contentWindow === frames[0] >>> >>> - is true when the (non-frameset) document contains at least one IFRAME. >>> >>> Does any part of that help? If so, which part? >> > >[...] > >> Some part of the FAQ should COVER obtaining a reference to an >>Object, >> including such as doc.gEBI, this.form, dot and ["string"], parent, >> child, name, etc., and then other parts of the FAQ can just say "Get a >> reference R to it (_Sec 35.26_), then ...". Example - section 9.7 (of >> Version 25) would say >> > >As in:- > > "What is a Reference?" >[explanation of Reference type] No. That is a different question; it is not "How to obtain a reference". >> Using the non-standard but widely implemented innerHTML property, get a >> reference R to the target (_Sec 35.26_), and assign the new material to >> R.innerHTML. >> REMOVE : Where "anID" is the (unique on the HTML page) >> (is handled in 35.25) id attribute value of the element to modify. >> > >You're switching the subject again, and now to the entry "How do I >modify the content of the current page?" That is not a switch; it is an example of how other entries need to change for the better when there is an earlier entry covering obtaining a reference. Obviously it would not otherwise be removed. >Regarding your comment for *that* entry, what do you mean by "handled >in 35.25"? It is the dummy number that I used four lines above. Are you really as obtuse as you pretend to be? -- (c) John Stockton, nr London 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 "-- " (RFCs 5536/7) Do not Mail News to me. Before a reply, quote with ">" or "> " (RFCs 5536/7)
First
|
Prev
|
Pages: 1 2 3 4 Prev: How can I make the browser display changes at once? Next: initializing style sheets and javascript |