Page 1 of 1

Javascript, Java Applet, & Output Buffering

Posted: Sun Dec 11, 2005 3:43 pm
by nigma
I've got a for loop that iterates a 1000 times. And, in each iteration I'm calling a method in a java applet that lights up a pixel on the screen. I've been told that I should see the pixels light up after each iteration, instead of at the end of the loop; however, this isn't happening. Is there a way I can make this happen?

Posted: Sun Dec 11, 2005 3:52 pm
by Roja
flush and ob_flush.

I suspect the output buffering needs to be flushed each iteration, so it sends.

Posted: Sun Dec 11, 2005 3:55 pm
by nigma
Sorry for not specifing Roja; there's no php involved, it's all javascript and java. Javascript to tell the java applet which pixels to light up, and the java applet to actually light up the pixels.

Posted: Sun Dec 11, 2005 4:30 pm
by Roja
nigma wrote:Sorry for not specifing Roja; there's no php involved, it's all javascript and java. Javascript to tell the java applet which pixels to light up, and the java applet to actually light up the pixels.
Then what is doing "Output buffering" ?

Show the code.

Posted: Sun Dec 11, 2005 5:13 pm
by nigma
Grrr... I don't know enough Java/Javascript to word my question right. Here's code:

Code: Select all

for (t = 0; t < 3.16E7; t += 1000) {
  // Calculate some position (x,y)
  jGraph.drawWorldPoint2d(x,y);
}
Should I be seeing the results of drawWorldPoint2d immediately after each call or only after the entire script is complete? I think this pertains to whether or not Java buffers output, but like I said, I don't know enough Java to be certain.