Apparently the Ajax image transition only looks nice when the images are cached on the browser. I was being so careless. There is another option to disable the cache on Firefox and when I used it, the image seems to be updated every second as I wanted. But now the transition is so visible. With that said, I'm not going to keep using Ajax.PeriodicalUpdater. Instead I will use Ajax.Request and retrieve the data one by one. Case closed. Thanks a lot everyone !!!
On Aug 29, 10:00 am, S <[EMAIL PROTECTED]> wrote: > That's how this whole thing was done before (put a timer that will > update the target image tag). I want to change it is because with that > method, the transition between images are so visible. What I hope to > achieve with Ajax is smoother transition between images so that it > will look like only a few parts of the image are changing, not the > whole image. I've tested Ajax by putting some images on the folder and > have them called randomly. You cannot see that the whole image is > actually updated and it looks much nicer. > > On Aug 29, 9:07 am, Diodeus <[EMAIL PROTECTED]> wrote: > > > > > Another method you can try is to grab not the image, but a "proxy" > > that will send the MIME header for the image then stream the file. > > This technique is used when images are stored in a database, or where > > people want to keep downloadable files outside of the web root to > > secure them from unauthorized download. You would have something like: > > <img src="serveImage.php?id=xxxxx">. > > > You could then just have a timer to update the SRC of the target image > > tag. This doesn't even require an Ajax call. > > > On Aug 28, 5:28 pm, S <[EMAIL PROTECTED]> wrote: > > > > I will use Ajax.Request as my last resort later. Right now I'm still > > > trying to useAjax.PeriodicalUpdaterto update the image from server > > > every second. I need to update a status page that contains many text > > > and images. Most of them need to be updated every second. I have > > > existing codes that convert all data to an image file which can be > > > loaded on web browser. > > > > The image is updated every second on the server. But, on the web > > > browser the image seems to be cached as it's only uploaded once and > > > never gets updated after. If I click on refresh or clear the cache on > > > the web browser, the image will be updated. I added non-caching > > > headers, tried it on IE, Firefox, and Opera with all caching and > > > cookie options disabled, added random number behind the URL called by > > >Ajax.PeriodicalUpdater, made the image really small and simple, .... > > > nothing works. I wonder whyAjax.PeriodicalUpdatercan't update image? > > > I tested the function with text and it works perfectly fine. Is it > > > browser orAjax.PeriodicalUpdaterissue? > > > > On Aug 28, 3:35 pm, "Nicolás Sanguinetti" <[EMAIL PROTECTED]> wrote: > > > > > for repeating execution you need setInterval, setTimeout only calls it > > > > once, or better yet (at least if you need more control) use > > > > Prototype's PeriodicalExecuter. > > > > > -foca > > > > > On 8/28/07, Diodeus <[EMAIL PROTECTED]> wrote: > > > > > > Yes, in this case use > > > > > Ajax.Request:http://www.prototypejs.org/api/ajax/request > > > > > > ..then just use setTimeout to keep calling the function periodically. > > > > > > On Aug 28, 1:12 pm, S <[EMAIL PROTECTED]> wrote: > > > > > > Yes, I'm a newbie in using Ajax and I don't use javascript a lot > > > > > > either ( I didn't even know what JSON was :P ). I was trying to save > > > > > > the value returned byAjax.PeriodicalUpdater, which I realized later > > > > > > that it's not gonna work. It only updates the value inside div > > > > > > directly. In that case, I'm forced to go to a totally different > > > > > > direction. Thanks Diodeus and Michael for your suggestions. I really > > > > > > appreciate it :) > > > > > > > On Aug 27, 3:30 pm, Diodeus <[EMAIL PROTECTED]> wrote: > > > > > > > > While I generally use JSON myself, judging from the skill level > > > > > > > of the > > > > > > > original poster, I would expect JSON would be a bit of a leap. > > > > > > > > On Aug 27, 3:17 pm, Michael Peters <[EMAIL PROTECTED]> wrote: > > > > > > > > > Diodeus wrote: > > > > > > > > > Create some sort of unique delimiter in your > > > > > > > > > responsedatastring to > > > > > > > > > separate the elements, such as "~". > > > > > > > > > You could do that, but then you're limiting yourself (limiting > > > > > > > > yourself to just > > > > > > > > arrays and whatdatacan be in those arrays). Why not just use > > > > > > > > JSON? Convert > > > > > > > > your PHP structure (array or hash) into a JSON string and then > > > > > > > > send it over the > > > > > > > > wire. > > > > > > > > > > Then turn the string into an array using (use your own > > > > > > > > > variable > > > > > > > > > names): > > > > > > > > > > mydata = myResponseText.Split('"~") > > > > > > > > > > mydata[0] will contain the first element, mydata[1] the > > > > > > > > > second etc. > > > > > > > > > This would then become > > > > > > > > > mydata = myResponseText.evalJSON(); > > > > > > > > > -- > > > > > > > > Michael Peters > > > > > > > > Developer > > > > > > > > Plus Three, LP- Hide quoted text - > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
