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


Groups > comp.lang.javascript > #9326

Re: Showing a 'Waiting ...' Message

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 <reply1150@merlyn.demon.co.uk>
Newsgroups comp.lang.javascript
Subject Re: Showing a 'Waiting ...' Message
Date Fri, 16 Dec 2011 21:17:12 +0000
Organization Home
Lines 69
Message-ID <Z4ipXeGYV76OFwDH@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <9kpg77Fu2fU1@mid.individual.net> <q3oie7hogiavnms7satu31bi8ct0qu05mc@4ax.com> <jccbqm$359$1@softins.clara.co.uk> <vkkke792atqf0sgm9u9ktcc69h7j2abl6b@4ax.com> <jcdloh$mkj$1@softins.clara.co.uk> <n70le79a1ccst08497ugge084fo9f5qctq@4ax.com>
Mime-Version 1.0
Content-Type text/plain;charset=us-ascii
Injection-Info mx04.eternal-september.org; posting-host="UwYDIHu13GPq28RciNoAJA"; logging-data="23644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p1kWKB19W2vq2Qbi3w7XYWX7yjmFcA5Y="
User-Agent Turnpike/6.05-S (<hY+ExRCkcsssDA9uJ+0bCn8+UA>)
Cancel-Lock sha1:Qr8OBrxt/ci13CQiQjk1Og/wa60=
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:9326

Show key headers only | View raw


In comp.lang.javascript message <n70le79a1ccst08497ugge084fo9f5qctq@4ax.
com>, Thu, 15 Dec 2011 15:24:04, Gene Wirchenko <genew@ocis.net> posted:


>     Now, why do I not find this sort of stuff written up in any books
>or Website that I read?  I only find out because of running into the
>problems.  Not the most efficient way of going about things, is it?

As far as I recall we know, you are relying on one very old book, which
you have not named.


Consider first a plain HTML page.  It is a nested structure of elements,
with an element represented by <tag> ... </tag> - though in some cases
(like <p>) the </tag> is not necessary in the HTML, as the parser can
see where it must be; and in other cases (like <hr>), where there is no
... part, there may be no closing tag.

That nested-box structure is equivalent to a tree structure, which is
easier to think about.  As time permits, that tree will be rendered on
the screen.  AIUI, script execution can interrupt rendering, but
rendering cannot interrupt script.

One particular box is the <script> box.

As the page source is read from wherever, with included files treated as
if in the source, it is parsed and the DOM tree is built.  Scripts found
are immediately executed.  Some pieces of script merely do internal
operations like arithmetic or string-twiddling.  Function statements
merely define functions, ready to be called.  Statements document.write
and document.writeln add to the DOM tree.  Statements can, by using
getElementById, walking the DOM tree, or using quasi-arrays such as
forms, alter the DOM tree; but they can only alter what already exists.

When the end of the source is reached, no further code is executed,
except as a result of an event.  Events are chiefly the result of mouse-
clicks, or of keyboard actions, or are caused by setTimeout expiring or
setInterval ticking (there may be others).

In event code, any unqualified document.write and document.writeln
writes to the current window, essentially uprooting the old DOM tree and
beginning a new DOM tree (it is possible that scripts or include files
may survive in some or all browsers).

NOTE : I/O elements within a Form [commonly] have a property 'form'
which is effectively a pointer to the form.  There is also a property
'this'.

Consider as an illustration an on/off button in a form
        <input type=button value=1 onclick="Cluck(this)">
with already constructed
function Cluck(Me) {
  (Me.value ^= 1) ? StopJob(Me.form) : StartJob(Me.form) }

Pressing the button toggles its value (I'm assuming buttons labelled
with 0 & 1 are known in BC) and starts or stops the Job (possibly in the
other order); and the job code has access to the value of Me.form which
it can use to read/write the Form.

The code has been tested.

I don't doubt your statement that there is nothing like that on the Web
that you can find; but you should not make such a statement again.

-- 
 (c) John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Turnpike v6.05   MIME.
   Web  <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)

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


Thread

Showing a 'Waiting ...' Message "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-13 10:26 -0700
  Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-13 12:17 -0800
    Re: Showing a 'Waiting ...' Message "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-13 15:31 -0700
      Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-13 17:50 -0800
        Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-13 18:10 -0800
          Re: Showing a 'Waiting ...' Message Martin Pearman <warwound@gmail.com> - 2011-12-13 23:07 -0800
            Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-14 10:46 -0800
              Re: Showing a 'Waiting ...' Message Jake Jarvis <pig_in_shoes@yahoo.com> - 2011-12-14 21:18 +0100
                Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-14 13:30 -0800
                Re: Showing a 'Waiting ...' Message "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-14 22:56 +0000
                Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-14 18:55 -0800
                Re: Showing a 'Waiting ...' Message tony@mountifield.org (Tony Mountifield) - 2011-12-15 08:40 +0000
                Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-15 12:08 -0800
                Re: Showing a 'Waiting ...' Message tony@mountifield.org (Tony Mountifield) - 2011-12-15 20:36 +0000
                Re: Showing a 'Waiting ...' Message Gene Wirchenko <genew@ocis.net> - 2011-12-15 15:24 -0800
                Re: Showing a 'Waiting ...' Message Scott Sauyet <scott.sauyet@gmail.com> - 2011-12-16 06:31 -0800
                Re: Showing a 'Waiting ...' Message Dr J R Stockton <reply1150@merlyn.demon.co.uk> - 2011-12-16 21:17 +0000
                Re: Showing a 'Waiting ...' Message "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-15 11:03 +0000
                Re: Showing a 'Waiting ...' Message Dr J R Stockton <reply1150@merlyn.demon.co.uk> - 2011-12-15 20:42 +0000
  Re: Showing a 'Waiting ...' Message Dr J R Stockton <reply1150@merlyn.demon.co.uk> - 2011-12-14 21:11 +0000
    Re: Showing a 'Waiting ...' Message "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-14 16:54 -0700
      Re: Showing a 'Waiting ...' Message "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-15 14:34 -0700

csiph-web