We have a span with the ID "nameSpan", preceded by "Hello," on line 7.įrom lines 8 to 11 we have some JavaScript logic to pick the name In the content section, we print a greeting message, based on the value set by the user for Name preference field. On line 4, we set a user preference with the preference name being "Name", display name being "Your Name" and default value being "World". In this gadget, we set the gadget title in the gadget preference section on line 3. Here is a sample gadget that demonstrates the three elements of a gadget.ĭocument.getElementById('nameSpan').innerHTML = prefs.getString("Name") You can find more information on the anatomy of a gadget on Google gadget basics documentation page. The following diagram portrays the overall gadget structure, which consists of the three main sections described above. Content Section: Specifies the content of the gadget, often using HTML and JavaScript programming logic.User Preferences: Defines controls that allow users to specify settings for the gadget.Gadget Preferences: Specifies characteristics of the gadget.Īnd a gadget consists of three main sections: In other words, a gadget is an XML document. The source code of a gadget is written in XML. Versatility of Google Gadgets as a Presentation Instrument Writing Google Gadgets – A tutorial – Part 04 Setting Preferences from Within the Gadget Writing Google Gadgets - A tutorial - Part 03 Using TEXT vs DOM Content Type when Working with HTML Writing Google Gadgets – A tutorial – Part 02
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |