The compilation of gadgets is actually very simple. You do not need to write your own gadgets if you understand HTML, JavaScript, and CSS. You can compile your own gadgets based on your needs and put them on your igoogle homepage or in some containers such as the Orkut website. The following is a sample tool provided by Google:
Code
<? XML version = "1.0" encoding = "UTF-8" ?>
module >
moduleprefs title =" Magic decoder " />
content type =" html " >
[CDATA [
// The Gadget version of rot13.
// Encodes/decodes text strings by replacing each letter with the letter
// 13 positions to the right in the alphabet.
Function decodemessage (form ){
VaR alpha = "abcdefghijklmnopqrstuvwxyz ";
VaR input = form. inputbox. value;
VaR Achar;
VaR message = "";
For (VAR I = 0; I < Input . Length; I ++)
{
Achar = Input. charat (I );
VaR Index = Alpha. indexof (Achar. tolowercase ());
// If a non-alphabetic character, just append to string
If (Index=-1)
{
Message += Achar;
}
// If you have to wrap around the end of the alphabet
Else if (Index > 12) {// compensate for 0-based index
Index = 25-index; // last item in array is at [25]
Index = 12-index; // Because array starts with 0
Achar = Alpha. charat (INDEX);
message + = Achar;
}
// If You Don't Have To wrap
Else {
Achar = Alpha. charat (index + 13 );
Message + = Achar;
}
}
Document. getelementbyid ('content _ Div '). innerhtml ="< B > Your message: </ B > "+ Message;
}
</ Script >
< Form Name = "Myform" Action = "" Method = "Get" > Message: < BR > < Input Type = "Text" Name = "Inputbox" Value = "" > < P > < Input Type = "Button" Name = "Button" Value = "Transform" Onclick = "Decodemessage (this. Form )" >
</ Form >
< Div ID = "Content_div" > </ Div >
]>
</ Content >
</ Module >
In this example, the tool application of rot13 is used. In rot13, each letter in the alphabet is replaced by a letter separated by 13 characters to encrypt the text. When you reuse rot13, it repeats each letter again to restore the original text.
Set this sectionCodeCopy to the GGE editor provided by Google, and put GGE on the homepage of my igoogle account for convenience.
Do not make any changes to the Code. Click the preview tab on GGE,
Enter "aabbcc ":
This is a simple tool.Source codeHosted on Google or any network server, you can add gadgets to Google,
Click "add"
Click "OK" to publish the tool to Google.