Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Why does alert make this work??


Message #1 by michael robertson <mike@m...> on Fri, 5 Oct 2001 08:40:40 -0400
I'm trying to get the following code to work in Netscape 4.x only. 
The alert statement is only there for testing the values passed and 
would be removed later. However it only works WITH the alert 
statement. If I comment it out, it no longer works.

Why???

<script language="Javascript">
function showImg(color) {

tX = (parseInt(document.f.red.value) + 
parseInt(document.f.yellow.value) + parseInt(document.f.orange.value) 
+ parseInt(document.f.green.value) +parseInt(document.f.blue.value)) 
+1;

var ev = eval("document.f." + color);
var val = parseInt(ev.value);
tr = val + 1;
ev.value = tr;

eval("document.cc" + tX + ".src='img_blender/blender_" + color + ".gif'");
alert(tX);

   }
}
</script>

  Return to Index