[Javascript] Refresh an image, change an image

Mike Dougherty mdougherty at pbp.com
Fri Jun 11 08:11:48 CDT 2004


If you use the source changing methods described already, you could point the img src to a dynamic 
file on the server.  In .asp terms, something like: src="/ImgSrvr.asp?pic=Image1"  then change to 
src="/ImgSrvr.asp?pic=Image2"

   The ImgSrvr.asp could even read the appropriate file from a non-web-accessible directory and 
(after ensuring the correct mime type) stream the file back to the <img> tag.  In the case you are 
describing, it sounds like you already have some kind of server-side CGI that's generating the 
image from data (like a chart or something)

   Maybe it's off topic here, but for dynamic web-based chart/report/graph manipulation - check 
out Crystal Reports. I saw an example of a web-based report with charts that allow drill-down and 
other really cool analytics - with about 4 lines of code for the web developer.  All of the 
stateful information (as well as resource overhead) is managed on a separate report server.  We 
use it to deliver highly detailed performance metrics to our intranet without needing to craft 
individual web pages (report design is easier to train than web/data integration)  ...Just a 
thought.


On Fri, 11 Jun 2004 08:30:37 +0100
  "Tim Makins" <spindrift at oceanfree.net> wrote:
>1st question:
>
>
><meta HTTP-EQUIV="Refresh" content="240">
>
>I am familiar with the above instruction that will refresh my page's entire
>contents every 240 seconds.
>
>but what I am wondering is this: Is it possible to refresh JUST one image on
>the page, such as the one below...
>
><div id="live_image">
><img src="http://www.company.com/images/live_image.gif" width="741"
>height="631" alt="" name="itsalive">
></div>
>
>
>My reason for asking is that the page has quite a few other images, but none
>of them need refreshing. Loading them all again would slow things down, and
>is really un-necessary.
>
>******************************************
>2nd question
>
>Assuming I want to change the above image on the page for a new one on my
>server, (not previously downloaded), such as
>http://www.company.com/images/live_image2.gif what would be the code for a
>form-button that would do that ?
>
>
>Note that pre-loading both images isn't an option as they are generated on
>the server.
>
>Tim in Ireland.
>
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list