Saturday, June 30th, 2007
How to write a Google Gadget
I’ve written some notes on the Google Gadget API and how to write a gadget, targeted at developers who already know Ajax.
What’s a Gadget?
- The gadget is an XML file sitting on your server. In my case, http://ajaxify.com/run/widgets/google/diggroundup.xml. It will get cached, so effectively it must be a static file.
- The user adds your gadget to their igoogle portal, or codes it into their own website, by specifying this URL (it may be done indirectly – via the gadget registry. You’ll appear in the registry if you’ve submitted your gadget to igoogle.)
- The gadget is rendered as an iframe, so you have all the usual security constraints which stop you borking the portal and other gadgets. This also means you can’t communicate with other Gadgets other than via than remote calls to a common third-party server (or has anyone tried hooking them together using the iframe-fragment identifier hack? ).
It’s based on a Digg Roundup tool, where the gadget show Digg stories according to user preferences such as topic and whether to go for popular or upcoming stories.













This is a great article. I’ve just started my own.
also there is the possibility to create html-inline gadgets which get written directly in your igoogle page (without iframes). These are capable of interact with other existing html-inline gadgets, but you cannot render them in your own websites.
I hope we will now have a tutorial for OpenSocial coz its mostly based on iGoogle and its gadget development environment.
this is a very nice tutorial. finally i can write my Google Gadget. :)
Very nice tutorial. Please give a tutorial on iGoogle.
i thing google use this function greatly this days in igoogle.
Good article. I think the gadgets are a very good addition to google.