Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
This document outlines how to use O3D inside an iGoogle or OpenSocial gadget. This process is very similar to creating a standalone page, except for a few restrictions imposed on the gadgets. iGoogle itself provides a very brief guide on how to migrate a standalone page.
Gadgets are essentially the same as pages, except that you only have control over a small part of the page—you cannot change the <head> section, and a lot of other things may be put in the body for you.
window.onload. Instead, you must use the provided API for registering such events. For instance, a call like this:
window.onload = myInitFunction;
should become something like this on both iGoogle v2 and OpenSocial:
gadgets.util.registerOnLoadHandler(myInitFunction);
or, if using the legacy iGoogle API:
_IG_RegisterOnloadHandler(myInitFunction);
<ModulePrefs title="My cool O3D app" title_url="http://www.mydomain.com/" height="200" author="Jane Smith" author_email="name@mydomain.com" />
or set it dynamically with:
gadgets.window.setTitle("My cool O3D app");o3djs/base.js), host the utilities on a server so that they are available via http:
<script type="text/javascript" src="http://www.mydomain.com/o3djs/base.js</script>
If listing your utility libraries using o3djs.require, also specify the base path of the 'o3djs' utilities directory location. For example:
o3djs.basePath=http://www.mydomain.com/;
o3djs.require('o3djs.util');
o3djs.require('o3djs.event');
To disable caching, append the ?nocache suffix to the
URL of your gadget XML specification. For example: http://www.mydomain.com/mygadget.xml?nocache.