Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16537
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Denis McMahon <denismfmcmahon@gmail.com> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: firstChild Problem |
| Date | Wed, 10 Oct 2012 17:40:31 +0000 (UTC) |
| Organization | A noiseless patient Spider |
| Lines | 32 |
| Message-ID | <k54bue$5t0$3@dont-email.me> (permalink) |
| References | <adlp3qFhpnlU1@mid.individual.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Wed, 10 Oct 2012 17:40:31 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="986f797cbd3b8f473a4775d73e9098bc"; logging-data="6048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vFDzpv6tZ2ZDlDBWzgmZeNUFKdLOZ8h0=" |
| User-Agent | Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2) |
| Cancel-Lock | sha1:76WxjFfN9UddI9Qq9+dM7r8+azM= |
| Xref | csiph.com comp.lang.javascript:16537 |
Show key headers only | View raw
On Wed, 10 Oct 2012 11:20:53 -0600, Mel Smith wrote:
> ***************************
> myjsfunc() {
> ..
> // I'm trying to initialize a text node with the word 'Searching'
> // But when I try to, then,
> // the next line results in a FireFox error: 'srchtxt.firstChild' is
> null
>
> // Here is the line that results in the error:
>
> srchtxt.firstChild.nodeValue = "Searching ...";
Assuming: <span id="srchtxt"></span>
// takes one param, expects boolean value
function displaySearchingText( searching ) {
var theSpan = document.getElementById( "srchtxt" );
while ( theSpan.childNodes.length != 0 )
theSpan.removeChild( theSpan.childNodes.item( 0 ) );
if ( searching )
theSpan.appendChild( document.createTextNode( "Searching ..." ) );
}
Rgds
Denis McMahon
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
firstChild Problem "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-10 11:20 -0600
Re: firstChild Problem -- Correction "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-10 11:35 -0600
Re: firstChild Problem -- Correction "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-10-10 20:42 +0300
Re: firstChild Problem Denis McMahon <denismfmcmahon@gmail.com> - 2012-10-10 17:40 +0000
Re: firstChild Problem Matt McDonald <matt@fortybelow.ca> - 2012-10-10 13:56 -0400
Re: firstChild Problem "Mel Smith" <med_cutout_syntel@aol.com> - 2012-10-10 12:13 -0600
csiph-web