Saturday, June 30th, 2007

How to write a Google Gadget

Category: Google, JavaScript, Programming, Widgets

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, 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.

Posted by Michael Mahemoff at 8:13 am

4.3 rating from 26 votes


Comments feed TrackBack URI

This is a great article. I’ve just started my own.

Comment by johno — July 1, 2007

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.

Comment by jiparis — July 2, 2007

I hope we will now have a tutorial for OpenSocial coz its mostly based on iGoogle and its gadget development environment.

Comment by tekAlign — November 20, 2007

this is a very nice tutorial. finally i can write my Google Gadget. :)

Comment by chrismcray — March 1, 2008

Very nice tutorial. Please give a tutorial on iGoogle.

Comment by ishoppe — April 10, 2008

i thing google use this function greatly this days in igoogle.

Comment by Loadtr — September 22, 2008

Good article. I think the gadgets are a very good addition to google.

Comment by gadgetreviewer — October 22, 2008

Leave a comment

You must be logged in to post a comment.