View Single Post
Old 08-28-2008, 06:32 AM   #4 (permalink)
flyingbuddha
The Contributor
 
flyingbuddha's Avatar
 
Join Date: Jan 2008
Location: Birmingham, UK
Posts: 60
Thanks: 10
flyingbuddha is on a distinguished road
Default

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);
__________________
Pro. Geek
http://www.mikeholloway.co.uk

Last edited by flyingbuddha : 08-28-2008 at 06:41 AM. Reason: Whoops, forgot to add the timestamp properly ;)
flyingbuddha is offline  
Reply With Quote