这个Google Gadget是第一个练手的作品,用来熟练Google Gadget的开发、调试、预览、存储、发布等各个环节。这个Gadget的功能是在网页上显示当前北京时间,方便在外国的朋友了解当前的北京时间。
写了两个版本一个是使用content type为html,另一个content type为url。体会一下两种写法的优劣。
使用url为content type的Google gadget代码在http://learnchinesekits.googlecode.com/svn/trunk/cct/CurrentChinaTime2.xml,与他相对应的程序文件是http://learnchinesekits.googlecode.com/svn/trunk/cct/CurrentChinaTime.php
使用html作为content type的Google Gadget代码在http://learnchinesekits.googlecode.com/svn/trunk/cct/CurrentChinaTime.xml
你可以在iGoogle以从url添加的方式将他们添加到你的iGoogle page里。或者可以将这个Gadgets添加到自己的网站,示例见本网站的Google Gadgets页面。
当然从程序角度这两个Gadget都有一些问题,比如显示时间的正确性依赖于服务器时间是否准确或者用户PC的时间是否准确。