Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old June 15th, 2006, 06:15 AM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ckamheng
Default periodical refresh

hi,
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.....
Thanks.

  #2 (permalink)  
Old June 15th, 2006, 06:46 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
  #3 (permalink)  
Old July 12th, 2006, 06:36 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.