| < Help Index | News Tab > |
The Code Tab gives you an editing environment that allows you to write
OpenSocial JavaScript code to run against the current container.
The Code Tab provides a toolbar to save and load your code samples. When you first load the tab, you will notice a large text area (4) containing sample OpenSocial code. You can run this code by pressing the Execute (5) button. To familiarize yourself with the OpenSocial APIs, try modifying the default code to perform different types of requests.
The code tab contains the following components:
Pressing the "Save code as" button will prompt you to save the
contents of the code textbox as a sample.
The Code Tab supplies a JavaScript API which you may use in your samples. Here is a list of functions you may call from code in this section:
| cls |
The cls method is shorthand for "CLear Screen". Use this to
clear the output buffer, as covered below.
|
|---|---|
| output |
Call the output method to print
text. output can take a variable number of arguments,
so you can print several variables on the same line without needing
to perform string concatenation yourself. If you have firebug installed and
enabled, output will also echo output to the firebug console,
meaning that you can inspect objects that you print using output
as well.
|
| < Help Index | News Tab > |