There is a series of JavaScript-based features available in the gadgets JavaScript specification to help you build out your application. The functionality these features offer ranges from embedding Flash movies to creating simple tabs.
These JavaScript features include those that are built for server
communication (e.g., content-rewrite
)
as well as for client communication (e.g., dynamic-height
). This means that your gadget can
use these features to communicate directly with the hosting server and to
create client-based functionality.
As shown in the following example, you can include a specific
feature by adding a Require
element in the
gadget XML spec file. Once initialized, the feature may be rendered via spec-defined JavaScript
initialization calls that you include in a Content
section:
<ModulePrefs> <Require feature="tabs" /> </ModulePrefs>
A number of JavaScript features are currently available through the gadgets spec; these are listed in Table 4-1.
Table 4-1. JavaScript features
Let’s explore some of these features in more depth and see how they can help personalize the gadget experience.
Get Programming Social Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.