Need help to refresh pic on sidebar widget in wordpress
I have added a cam that upload a picture to a wordpress site that I want to auto refresh by itself but I don't want the page to refresh.
At the moment I have managed to get it to work if you click on a link the pic will refresh only and the page is not refreshed. It is part of a news site.
This is the code I found and is using. If anybody can help it would be much appreciated
cam.js
|
function reloadImg(id) { var obj = document.getElementById(id); var src = obj.src; var pos = src.indexOf('?'); if (pos >= 0) { src = src.substr(0, pos); } var date = new Date(); obj.src = src + '?v=' + date.getTime(); return false; } |
|
<head> <script type="text/javascript" src="cam.js"></script> </head> |
|
<img src="out.jpg" id="img" /> <a href="#" onClick="return reloadImg('img');">Reload Image</a> |
I need to add that the pic must not refresh from the browser cache but when refresh reload from the server as this pic is uploaded from the cam every 15 seconds
[LIMITED ACCESS + FREE ARTICLE INCLUDED OR YOUR OWN]
CLICK HERE NOW
[LIMITED ACCESS + FREE ARTICLE INCLUDED OR YOUR OWN]
CLICK HERE NOW
[LIMITED ACCESS + FREE ARTICLE INCLUDED OR YOUR OWN]
CLICK HERE NOW
[LIMITED ACCESS + FREE ARTICLE INCLUDED OR YOUR OWN]
CLICK HERE NOW
[LIMITED ACCESS + FREE ARTICLE INCLUDED OR YOUR OWN]
CLICK HERE NOW