How to Make WEL Images Update Automatically

How to Make WEL Images Update Automatically

<p>How to make WEL images update automatically. </p><p>The following code shows how to make a WEL image refresh automatically on your own web page. The example shown here displays the live system image and two charts: Zones and Power.</p><p>The yellow section contains the scripts that do the initial image retrieval and then the 5 minute refresh. The initial retrieval is there to make sure that the person’s browser doesn’t use an old copy of the chart that it has in cache. This code can be put anywhere between the <Head> and </Head> tags.</p><p>The green section shows what is different from page to page. There is a line for each image on the page that needs to be refreshed. The text in the single quotes MUST match the ID and Name attributes that are added to the HTML later on.</p><p>The blue text is code that gets added to the body of the html. The “onload” code forces the updating process to be started once the page has fully loaded the first time. The ID and Name are used to identify the images to be updated. For consistency, I use the exact same text as the base of the image filename, which is the same as the name of the graph.</p><p><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"></p><p><SCRIPT LANGUAGE = "Javascript"> <!-- // (c) Phil Malone [email protected] // This user function accepts new data to be used on this page</p><p>// Called after loading page contents function WEL_FirstUpdate() { WEL_ImageUpdate(); setInterval( "WEL_ImageUpdate()", 300000 ); }</p><p>// Called every 5 Mins after first load function WEL_ImageUpdate() { var X = new Date(); document.images['system'].src="/cgi-bin/live/WEL1000/system.png" + X ;</p><p> document.images['zones'].src="/cgi-bin/plot/WEL1000/zones.gif?" + X ; document.images['power'].src="/cgi-bin/plot/WEL1000/power.gif?" + X ; } // END OF HIDDEN SCRIPT --> </SCRIPT></p><p><title>Trends</title> </head></p><p><body bgcolor="#ffffff" onload="WEL_FirstUpdate();"> <div align="center"> <h1>9 Hour Trend Data </h1></p><p><!-- WEL: Add ID and Name to each image. Use this text in the SCRIPT section above --></p><p><Img src="/cgi-bin/live/WEL1000/system.png" ID="system" Name="system" ><P> <Img src="/cgi-bin/plot/WEL1000/zones.gif" ID="zones" Name="zones" ><P> <Img src="/cgi-bin/plot/WEL1000/power.gif" ID="power" Name="power" ><P> <h1></h1> </div> </body> </html></p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us