topical media & game development
basic-ajax-07-webservice2.js / js
function getTime(JSONData) {
if (JSONData != null)
{
alert(TimeStampToDate(JSONData.Result.Timestamp));
}
}
function TimeStampToDate(xmlDate)
{
return new Date(xmlDate);
}
function dynamicTag()
{
request = "http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooDemo&output=json&callback=getTime&format=ms";
var head = document.getElementsByTagName("head").item(0);
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", request);
head.appendChild(script);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.