APIFinder
   The essential directory of application programming interfaces
Submit an API
DevX
Function
Language/OS
Contribute
About
Browse DevX
advertisement
Log In | Register
Will Your Next Web Application Be a Google Gadget?
Learn how to leverage the Google Gadget API to make your web applications more reachable. As an example, you'll see how to build a real-world gadget that fetches and displays the DevX feeds. 
April 8, 2008

advertisement
Since AJAX first appeared, developer interest in JavaScript has increased exponentially—and toolsets for building functionality in JavaScript have burgeoned as well. One of the latest tools for JavaScript-related development is Google Gadgets. Many web sites already provide gadgets built with the Google tools, and you can, too. This article shows you how to develop a Google Gadget that fetches DevX RSS feeds and displays them to the user.

Anatomy of a Google Gadget
Developing a Google Gadget (simply gadget from now on) is really an easy task. After all, a gadget is made of XML, HTML, JavaScript, and optionally, CSS, used as follows:

  • XML describes the gadget's structure.
  • HTML and CSS provide the presentation layer.
  • JavaScript supplies the gadget's logic.
The XML below shows the basic gadget structure:

 <?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="A title" />
<Content type="html">
<![CDATA[
<!-- Here the CSS, JavaScript and HTML code -->
]]>
</Content>
</Module>
Here's a breakdown of the XML elements. The root element is Module. The ModulePrefs element holds information about the gadget (title, height, and so on) and its author—more on this later. The Content element is apt to contain the "real" content—the CSS, HTML, and JavaScript code. As you'll see later on, there are other elements to consider, but these are the basic elements you'll use in each and every gadget you develop.

A Simple "Hello, World" Gadget
The easiest way to start learning a new programming language or technology is to dive right in with a simple example. Here's the code for a gadget that just prints out the traditional "Hello, World" message in a box:

 <?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Hello world example" />
<Content type="html">
<![CDATA[
<div id="content" style="color: red;">
hello, world!
</div>
]]>
</Content>
</Module>
Save the preceding XML file using the name hello-world.xml. You won't use this right away—I'll show you how to deploy it in the next section.

Continue reading article on DevX.com...

Alessandro Lacava is a software engineer and technical writer based in Italy. During his career he's been involved in designing and developing applications using many different programming languages and technologies, such as: Object-Oriented Programming, Design Patterns, UML, Java (ME - SE - EE), .NET, PHP, C, JavaScript, Ajax, HTML, CSS, Oracle, PL/SQL, MySQL, XML, XSL, JSON. Alessandro holds a degree in Telecommunications Engineering. You can reach him via his Web site at http://www.alessandrolacava.com


Google Gadgets API
This API is designed specifically to let individuals enhance Google "personalized homepages." The personalized homepage feature lets you add various types of content widgets (gadgets) to the Google home page when you go to it (e.g. local weather, sports info, stock quotes, etc.) Once you've created a gadget you can share it with anyone you like by getting them to add your gadget or you can submit it to Google for inclusion in the gadget directory. (No download is necessary. Link goes to a developer guide for the XML specification language.)
Provider: Google   Cost: 0




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES