|
|
|
|
|
- Overview
- Example: Retrieving a task list from a Google calendar
Handling external JavaScript objects from WLanguage
The WLanguage in "Browser" mode is used to interface with the Web APIs such as the ones proposed by Google or Yahoo. The interaction with the external components proposed by these sites is simplified. You have the ability to allocate external Javascript objects in browser code written in WLanguage. The use of external JavaScript objects does not necessarily require the use of the JavaScript language: the programming can be done in WLanguage Example: Retrieving a task list from a Google calendar To retrieve a task list from a Google calendar: - Include the programming interface of Google calendar in the page.
- Display the "Advanced" tab of the page description.
- In the "HTML" tab, add the following line of code into the HTML code of the page header:
<script type="text/javascript">google.load("gdata", "1");</script> This code is supplied in the Google documentation. - In the "JavaScript" tab, click the "Add a Web resource" button. Enter the address used to include the calendar service:
http://www.google.com/jsapi?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (the code of the key corresponds to your personal code).
- Enter the browser code used to retrieve the task list:
MyCalendarService is dynamic object MyCalendarService = new object "google.gdata.calendar.CalendarService" MyTasks is dynamic array MyTasks = MyCalendarService:feed:entry // Browse the array to fill the list FOR i = 1 TO Dimension(MyTasks) ListAdd(LIST_Task_Choice, MyTasks[i]:getTitle():getText()) END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|