08-28-2008, 06:32 AM
|
#4 (permalink)
|
|
The Contributor
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
|
So you are looking for some code ;)
I've not tested this as I'm off to work now, you may have some problems in PC IE, if you do, let me know and I'll fix it for you.
Code:
var refresh = setInterval(function(){
// create a new timestamp
var timestamp = new Date();
// keep track of the image we're going to work on
var img = document.getElementById('id_of_your_img');
// make sure the pic. exists before operation
if(img){
// get the source of the pic. (minus any previous appenditures)
var src = img.getAttribute('src').replace(/\?time=.+$/i,"");
// set the source of the pic. to the current src + timestamp (querystring)
img.setAttribute('src',src +"?time="+timestamp.getSeconds());
}
},1000);
Last edited by flyingbuddha : 08-28-2008 at 06:41 AM.
Reason: Whoops, forgot to add the timestamp properly ;)
|
|
|
|