Javascript, Java Applet, & Output Buffering

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Javascript, Java Applet, & Output Buffering

Post 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?
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

flush and ob_flush.

I suspect the output buffering needs to be flushed each iteration, so it sends.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post 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.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post 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.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post 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.
Post Reply