PDA

View Full Version : I'm doing a Periodic Update but it looks like Incrermental Update



purifier
02-23-2008, 04:08 PM
I have written a small script using prototype. I have two drop down boxes. The choices in the second one depend on the first one. So I use ajax to get the choices and populate the boxes. When the second box is selected, I wrote a function to initiate a Ajax.PeriodicalUpdater call to refresh a div tag every few seconds. So far, so good. Everything is working. I'm able to see an image(I displayed it) refresh itself.

Now, when I select another option from the second box, the new image is appearing but the old one is coming too. I mean, first the old one comes, then refreshes into the second one. I've been trying to get over this problem but in vain. Can someone please help me out?

The page can be seen here:


www.intellinexus.com/planetlab/spider.php

TimFA
02-23-2008, 04:22 PM
I don't really understand the script on that page, I tried it and got lots of googly code pop up in an alert box...

purifier
02-23-2008, 04:34 PM
Sorry I was trying to debug the code...I removed the alert boxes... You can have a look at it now...

TimFA
02-23-2008, 04:50 PM
Thought I'd have a look to see if by some luck I could help, but I can't. Sorry.

purifier
02-23-2008, 05:17 PM
Oh :( Its ok. I'll wait for someone to give it a shot... Just in case, my problem is something like:

Once I click on a submit button, I need to send the request to a php file which will give me an image file which i'm displaying. Now, as the php file generates a new image every few seconds, I want to update the corresponding figure on this page...

TimFA
02-23-2008, 05:24 PM
It makes sense, why not just make another request so the PHP spits out a new image immediately?

purifier
02-23-2008, 07:29 PM
I'm afraid I didn't understand what you meant. Sorry about that...

williamstam
04-29-2008, 11:55 AM
hmm i had similer problems diferent but similer...
i fixed the issue by calling the page with a unique string..

so say i wanted to load page x in page y (stuff changes in page x regularly as its drawn from a database) i set all my refrences to that page as x?dummy=<the current date time-in asp its <%= now() %>>&anything else

so basicaly to the browser it looks like a new "page" sounds stupid but its worked for me