1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| var xhr;
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); }
catch (e)
{
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); }
catch (e2)
{
try { xhr = new XMLHttpRequest(); }
catch (e3) { xhr = false; }
}
}
xhr.onreadystatechange = function()
{
if(xhr.readyState == 4)
{
if(xhr.status == 200)
$("#timezone").html("Received:" + xhr.responseText);
else
document.ajax.dyn="Error code " + xhr.status;
}
};
$url="https://maps.googleapis.com/maps/api/timezone/xml?location="+pos.coords.latitude+","+pos.coords.longitude+"&timestamp="+Math.round(new Date().getTime() / 1000)+"&sensor=false";
xhr.open( "GET", $url, true);
xhr.send(null); |