Wrox Programmer Forums
BOOK: Professional Ajax ISBN: 978-0-471-77778-6
This is the forum to discuss the Wrox book Professional Ajax by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780471777786
Important: For the new 2nd edition of this book, please post here instead: [url="http://p2p.wrox.com/forum.asp?FORUM_ID=307"]http://p2p.wrox.com/forum.asp?FORUM_ID=307[/url]
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax ISBN: 978-0-471-77778-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 15th, 2006, 06:15 AM
Registered User
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ckamheng
Default periodical refresh

i am having difficulties here.
Below is my situation:

i need to periodically refresh a jpeg image in a web page. The jpeg image is stored in a server with apache installed. The jpeg image's source is coming from a live camera connected to the server.

how to write a program in ajax to update the jpeg image every 5 seconds.Given that the jpeg image changes every 5 seconds.

Note: i am using <img> tag and the <img> is located in a <table> with <tr> and <td>.

Can anyone write me a working sample program please. I tried b4 but the jpeg image keeps on flickering.....

Old June 15th, 2006, 06:46 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

In my opinion you don't need AJAX for this. If the image's URL is always the same you can just use setInterval to set it to the real URL but with a spurious querystring to force a refresh. E.g. if the URL is getMyImage.php?id=123 then set it to getMyImage.php?id=123&r=123456 where the r= part is a random number, based on the time perhaps.


Joe (Microsoft MVP - XML)
Old July 12th, 2006, 06:36 AM
Registered User
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

I think this is just what I want - in a round about way. I am a complete n00b at Java/ajax tho.

What I have, is a very annoying page with a complicated sign-in that times out after 5 minutes. What I want to do is load it into a frame where Javascript periodically reloads it to refresh the timeout.

Is this possible? Could someone show me a basic example? I'd be ultra-grateful!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
refresh crmpicco HTML Code Clinic 7 January 31st, 2005 09:43 PM
refresh kilika Javascript How-To 2 September 16th, 2003 05:44 PM
refresh kilika VBScript 0 September 16th, 2003 01:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.