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


Groups > comp.lang.javascript > #37035

Clearing/Writing a daughter window ?

Newsgroups comp.lang.javascript
Date 2019-08-03 10:46 -0700
Message-ID <2e2a80c3-e3bb-4e10-8be1-48c21f76f441@googlegroups.com> (permalink)
Subject Clearing/Writing a daughter window ?
From dr.j.r.stockton@gmail.com

Show all headers | View raw


OK, my test HTA can now open and close daughter windows,
and can write to them.

But I want to clear and refill a daughter window, rather
than closing a daughter and opening a new one, which I
suspect of being slower.

The following code, as expected, puts both pages into
the one window, 3 following 2 (sections 2 & 3 differ
only in their digit).

Other than closing Wndw and opening another Wndw, is
there something that I can put as position X to restore
Wndw to the freshly-opened state?

Alternatively, is there a better way of loading sFileDat
into Wndw, maybe by assignment, so that any previous content
of Wndw is no longer there (and best, given explicitly
to the garbage collector)?

There will be a few hundred executions of opentextfile as
the script's attention roams from page to page.



// 1
Wndw = window.open("", "Y"+new Date().getTime(), "")

// 2
sSrcFile = "C:\\homepage\\zel-82px.htm"
oSrcFile = fso.opentextfile(sSrcFile, ForReading) 
sFileDat = oSrcFile.ReadAll()
oSrcFile.Close()

Wndw.document.writeln(sFileDat)

// X

// 3
sSrcFile = "C:\\homepage\\zel-83px.htm"
oSrcFile = fso.opentextfile(sSrcFile, ForReading) 
sFileDat = oSrcFile.ReadAll()
oSrcFile.Close()

Wndw.document.writeln(sFileDat)

// ...

-- 
  (c) John Stockton, near London, UK.  Using Google Groups.           |
 Mail: J.R.""""""""@physics.org - or as Reply-To, if any.             |

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


Thread

Clearing/Writing a daughter window ? dr.j.r.stockton@gmail.com - 2019-08-03 10:46 -0700
  Re: Clearing/Writing a daughter window ? "R.Wieser" <address@not.available> - 2019-08-04 09:47 +0200
  Re: Clearing/Writing a daughter window ? JJ <jj4public@vfemail.net> - 2019-08-06 00:32 +0700
    Re: Clearing/Writing a daughter window ? dr.j.r.stockton@gmail.com - 2019-08-06 04:13 -0700
      Re: Clearing/Writing a daughter window ? JJ <jj4public@vfemail.net> - 2019-08-07 21:27 +0700
    Re: Clearing/Writing a daughter window ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-08-08 15:00 +0200

csiph-web