Question:
I use the FTP option to upload live images to my webspace, is there any easy way that I can have my webpages show the live images?
Answer:
There is a way to do this:
-
Copy the code between the two horizontal lines below into an empty notepad window.
-
Change the image filename in the code (shown in red below) to suit your FTP image filepath.
e.g. change to "http://www.mysite.com/ftp-folder/image1.jpg"
-
Save the notepad text as a HTM file named whatever you like, e.g. "camviewer.htm".
-
Upload the HTM file to your webspace using FTP or your webspace management pages online. You can place the page wherever you want.
-
Now you can view the page by simply typing its URL (web address) into any web browser.
e.g. "www.mysite.com/camviewer.htm"
<!-- HERES THE JAVASCRIPT THAT REFRESHES THE IMAGE BELOW -->
<script language="JavaScript" type="text/JavaScript">
var Mutex = 0;
function loadImage()
{
if(Mutex == 0)
{
Mutex = 1;
var url;
url = 'image1.jpg';
var tag = "?t=";
tag += (new Date()).getTime();
url += tag;
document.images.IMAGE.src = url;
setTimeout('loadImage()',1000);
Mutex = 0;
}
}
setTimeout('loadImage()',1000);
</script>
<!-- HERES THE IMAGE PLACED ON THE WEBPAGE -->
<img src='image1.jpg' name="IMAGE" id="IMAGE">
<!-- HERES WHAT HAPPENS WHEN NO JAVASCRIPT IS ENABLED -->
<noscript>
<br>Please Enable JavaScript to see the live feed update automatically!
</noscript>
<!-- HERES A LINK TO CAM WIZARDS HOMEPAGE -->
Live feed created with
<a href="http://www.CWZD.com">CAM Wizard</a>
</div>
<!-- END OF VIEWER PAGE -->
|