0

I am developing a messaging system and through discussion here: webBrowser.Document.Write() Irregular Performance I decided to rewite some of the core login in my program in Javascript.

The demo seen here: http://nathantornquist.com/code/misc/index6.html runs perfectly when you are adding messages from John. As soon as you add a message from Jack, the timer gets messed up and the color of the date on John's messages stop changing.

Can anyone see a clear reason why?

Community
  • 1
  • 1
Nathan Tornquist
  • 6,468
  • 10
  • 47
  • 72

3 Answers3

0

Did you check the console in Firefox or Chrome? I checked it out and got an error when clicking "Add a message from Jack"

Uncaught ReferenceError: black is not defined
switchColorindex6.html:74
(anonymous function)

Is black a variable that should be defined?

Nick DeFazio
  • 2,412
  • 27
  • 31
0

On lines 74 and 76 you have black not quoted, e.g.

        if (!elements[i].style.color!=black)

Try quoting it:

        if (!elements[i].style.color!="black")
Asmor
  • 5,043
  • 6
  • 32
  • 42
0

You have some errors in lines 72-78. One is that you compare color to black which is undefined. Probably it should be 'black'. Second is elements[i].stlye on line 76.

Krzysztof
  • 15,900
  • 2
  • 46
  • 76