Here's the code in the function:
function addEvent(eventTitle, startDateTime, endDateTime) {
/*
* Create a single event
*/
// Create the calendar service object
var calendarService = new
google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');
// The default "private/full" feed is used to insert event to the
// primary calendar of the authenticated user
var feedUri = 'http://www.google.com/calendar/feeds/default/private/
full';
// Create an instance of CalendarEventEntry representing the new event
var entry = new google.gdata.calendar.CalendarEventEntry();
// Set the title of the event
entry.setTitle(google.gdata.Text.create(eventTitle));
// Create a When object that will be attached to the event
var when = new google.gdata.When();
// Set the start and end time of the When object
var startTime = google.gdata.DateTime.fromIso8601(startDateTime);
var endTime = google.gdata.DateTime.fromIso8601(endDateTime);
when.setStartTime(startTime);
when.setEndTime(endTime);
// Add the When object to the event
entry.addTime(when);
// The callback method that will be called after a successful
insertion from insertEntry()
var callback = function(result) {
PRINT('event created!');
}
// Error handler will be invoked if there is an error from
insertEntry()
var handleError = function(error) {
PRINT(error);
}
// Submit the request using the calendar service object
calendarService.insertEntry(feedUri, entry, callback,
handleError, google.gdata.calendar.CalendarEventEntry);
}
On Jul 18, 4:06 pm, helpless <[EMAIL PROTECTED]> wrote:
> I used the interactive JS sample to generate code for the add event
> method.
>
> The page is athttp://goldenloopstudio.com/whiteninja/gtest1.html
>
> This may sound stupid but can someone point me to how I can retrieve
> the output that is in the callback function in the source code. When I
> call the addEvent function there is data being outputted, but it isn't
> being returned outside of the function call. Do I need to do something
> else to grab the confirmation output or error verbiage to my web
> client?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---