How to implement a gadget in a website ?

HI

I would like to implement some kind of "gadget" in a website that could show the weather and the time. I know both depend on the location, is there any way to detect the area where the user is connected. Is this a free service?

In case the weather could be a complication, could you tell me how to show only the time ?

Thanks in advance.
dimensionavAsked:
Who is Participating?
 
Gregory_VCommented:
There's always google gadgets...

http://www.google.com/ig/directory?synd=open

0
 
rajapandian_81Commented:
Use javascript to get the client machine time.

var now = new Date();

var hour = now.getHours();
var min = now.getMinutes();
var second = now.getSeconds();

alert(hour + ':' + min + ':' + second);

Open in new window

0
 
dimensionavAuthor Commented:
rajapandian_81:
How could I show that date permanently in a cell of a table ?
0
 
rajapandian_81Commented:
Try below kind of code.

60 secs once, the function DisplayTime will be called and the time will be updated in table cell tdTest.
function DisplayTime()
    {
        var now = new Date();
        var hour = now.getHours();
        var min = now.getMinutes();       
        document.getElementById("tdTest").innerHTML = hour + ':' + min;
    }
    setInterval ( "DisplayTime()", 60000 );



<table><tr><td id="tdTest"></td></tr></table>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.