Javascript Continuous Redirect
===

I have this page loading fine once... 

Basically it is pulling a gps location, I then want it to do the redirect every 10 seconds to pull gps data again...

But it will not continually redirect every 10 seconds...

What up - by the looks of things it should...


      <script type="text/javascript"> 

	// Get a single location update
	function getLocationConstant()
	{
		if(navigator.geolocation)
		{
			navigator.geolocation.getCurrentPosition(onGeoSuccess,onGeoError,{enableHighAccuracy:true,maximumAge:0});
		} else {
			alert("Your browser or device doesn't support Geolocation");
		}
	}

	// If we have a successful location update
	function onGeoSuccess(event)
	{
		document.getElementById("Latitude").value =  event.coords.latitude; 
		document.getElementById("Longitude").value = event.coords.longitude;
		document.getElementById("location").href = "track2.cfm?track=s&GPSLat=" + event.coords.latitude + "&GPSLong=" + event.coords.longitude;

		redirectUrl = "track2.cfm?track=y&GPSLat=" + event.coords.latitude + "&GPSLong=" + event.coords.longitude; 

		gpslat = event.coords.latitude; 
		gpslong = event.coords.longitude; 
		
	}
 
	// If something has gone wrong with the geolocation request
	function onGeoError(event)
	{
		alert("Error code " + event.code + ". " + event.message);
	}
	
	function redirect() 
    { 
        window.location = redirectUrl; 
    } 
    setTimeout(redirect,10000); 
	
     </script>
