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


Groups > comp.lang.javascript > #23496

Re: onLoad () and onChange()

From "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: onLoad () and onChange()
Date 2014-03-10 16:00 +0200
Organization A noiseless patient Spider
Message-ID <lfkgh4$j4e$1@dont-email.me> (permalink)
References <8385c017-1426-4c2d-bdb3-2dd60a629819@googlegroups.com> <lfji6n$89u$1@dont-email.me> <78e0d96e-69e9-464d-8379-c41c547ff1c6@googlegroups.com>

Show all headers | View raw


2014-03-10 14:17, jonas.thornvall@gmail.com wrote:

> [...] i create
> the array objects global to make them accessible Before changing
> color of objects. I have a function recheck that is called onChange()
> in the HTML. This functions is also called from HTML onLoad() by
> function firt_call()---->recheck();
>
> It seem my global initiation and creaton of objects do not work which
> i find strange. I am quite sure that the recheck() is somehow called
> Before the global objects created.

Well, a simple way to check this is to put a console.log(...) statement 
at the start of the body of first_call() and at the start of the body of 
recheck(). It turns out that first_call() is called first, as we can expect.

The console log (on Chrome) then says:

"Uncaught TypeError: Cannot set property 'rcolor' of undefined"

at line 518. There might be something wrong with the way the arr[] array 
is indexed.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

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


Thread

onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-09 17:06 -0700
  Re: onLoad () and onChange() "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-10 07:22 +0200
    Re: onLoad () and onChange() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-10 09:49 +0100
      Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 06:56 -0700
        Re: onLoad () and onChange() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-10 15:28 +0100
    Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 05:17 -0700
      Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 05:55 -0700
      Re: onLoad () and onChange() "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-03-10 16:00 +0200
        Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 07:32 -0700
          Re: onLoad () and onChange() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-10 15:46 +0100
            Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 09:58 -0700
              Re: onLoad () and onChange() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-03-10 23:15 +0100
          Re: onLoad () and onChange() Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-03-10 17:03 +0000
            Re: onLoad () and onChange() jonas.thornvall@gmail.com - 2014-03-10 10:29 -0700

csiph-web