Introduction to interactive samples
One of the advantages of having a JavaScript client library is that it allows us to provide an interactive browser environment to render sample codes.
The ability to play with the code as you are going through samples is a great way to learn a new client library. The following samples are completely interactive, you are able to modify and execute the code straight out of the source code textarea. Feel free to modify the source code to get a feel for how the different objects and properties are used. You can utilize the predefined PRINT() method which outputs the argument as a string in the output tab after you hit the "Run" button.
The default sample codes are structured to minimize the incidence of accidental update or delete. All data input for the default sample codes are using strings that are prefixed with "JS-Client" for things like portfolio name. This way the samples will be prevented from updating or deleting your personal portfolios. But caution should always be exercised, as you are able to change the code any which way you desire.
Finally, if you have trouble, it might be handy to use a javascript debugger to examine problems, such as Firebug for Firefox.
|
Creating Data: Creating a Portfolio Creating a Transaction |
Retrieving Data: Retrieving all Portfolios Retrieving a specific Portfolio Retrieving Transactions Retrieving Positions |
Updating Data: Updating a Portfolio Updating a Transaction |
Deleting Data: Deleting a Transaction Deleting a Portfolio |
Note: In order to execute the following interactive JavaScript samples, you must authenticate using your Google account credentials.