Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.javascript Subject: Re: Weird Code: Check My Reading of It Date: Sat, 10 Dec 2011 20:37:59 +0000 Organization: Home Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="UwYDIHu13GPq28RciNoAJA"; logging-data="24352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5I/WlsBcU00NSnoLwE21leax3JkvF6R0=" User-Agent: Turnpike/6.05-S () Cancel-Lock: sha1:ioNgrmGoqaQEopuPJg9NussAMNs= Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:9109 In comp.lang.javascript message , Thu, 8 Dec 2011 20:46:41, Gene Wirchenko 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 - w. FAQish topics, links, acronyms PAS EXE etc. : - see in 00index.htm Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.