[thelist] javascript poser

The Optimizer chrism at puffofsmoke.net
Tue Jul 24 04:23:13 CDT 2001


Albie

> I've created a rather nifty virtual web assistant which would be
> perfect if
> I didn't have the following glitch:
>
> Every time enter is pressed twice in a row or the 'talk to me' button is
> clicked twice, I get duplication of the image besides the text box.
>
> Can anyone suggest how I can amend my code to stop this happening?

I /think/ that the following is to blame:

function reply(){

document.face.src="anna_pics/anna"+(Math.round(Math.random()*33)+1)+".jpg";
   document.talker.src = "anna_pics/annasays.gif";
   phraseentered = document.chatform.speechbox.value.toLowerCase();
   if (phraseentered==""){
      document.talker.src = "anna_pics/anna18.jpg";
               ^^^^^^
//-- I think this should be 'face'..?
      document.chatform.speechbox.value="Pardon?";
      return;
   }
//-- Rest of function snipped
}

Sorry, it's only a quick scan so I could be wrong; but it's something along
those lines. BTW, did I promise to do anything that I didn't? Things got
really busy really fast around here.

Regards

Chris Marsh





More information about the thelist mailing list