Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #9109

Re: Weird Code: Check My Reading of It

From Dr J R Stockton <reply1149@merlyn.demon.co.uk>
Newsgroups comp.lang.javascript
Subject Re: Weird Code: Check My Reading of It
Date 2011-12-10 20:37 +0000
Organization Home
Message-ID <CPffKVGnM84OFwCx@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <k243e7ltslnc4op0hd6api696jep2qja0j@4ax.com>

Show all headers | View raw


In comp.lang.javascript message <k243e7ltslnc4op0hd6api696jep2qja0j@4ax.
com>, Thu, 8 Dec 2011 20:46:41, Gene Wirchenko <genew@ocis.net> posted:

>***** Start of Oddball Code *****
>function writeDocument(n,s) {
> var doc=parent.frames[1].frames[n].location = s
>}
>***** End of Oddball Code *****

From the function line, I would half-expect that to have been intended
to write the general HTML string s into the specified frame, in which
case there is a missing (.innerHTML || .somethingElse).

>     As I read this, the location for a frame will be set to s.  doc,
>a local variable, will be set to s as well.  But this is all there is
>to the function, and therefore, the
>          var doc=
>part of the body serves no useful purpose.

Yes.  I would have used location.href.

>  (I
>did not know about JavaScript's multiple assignment

Be careful with it.

X = Y = 3          ; Y++             ; Z = [+X, +Y]     // [3, 4]
X = Y = new Date() ; Y.setTime(3456) ; Z = [+X, +Y]     // [3456, 3456]

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Weird Code: Check My Reading of It Gene Wirchenko <genew@ocis.net> - 2011-12-08 20:46 -0800
  Re: Weird Code: Check My Reading of It David Mark <dmark.cinsoft@gmail.com> - 2011-12-08 21:34 -0800
    Re: Weird Code: Check My Reading of It Norman Peelman <npeelmandog@cfl.rr.com> - 2011-12-09 06:55 -0500
      Re: Weird Code: Check My Reading of It David Mark <dmark.cinsoft@gmail.com> - 2011-12-09 12:07 -0800
      Re: Weird Code: Check My Reading of It Gene Wirchenko <genew@ocis.net> - 2011-12-09 10:09 -0800
  Re: Weird Code: Check My Reading of It Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-10 20:37 +0000

csiph-web