Hi, I literally copied-pasted some JS code from the developers guide to insert an event on the users calendar but it's not working. I don't know what I'm doing wrong.
<script type="text/javascript" src="http://www.google.com/jsapi? key=ABQIAAAALFJ2c6HQGlU3drej7n5h_hToBR_vnWk6cftlfsPCwP5mfehuMBRK1GO3OV0oyIm8bU8IvTghC_Y6oQ"></ script> <script type="text/javascript"> google.load('gdata', '1.s'); google.setOnLoadCallback(getMyFeed); var feedUrl = "http://www.google.com/calendar/feeds/ [EMAIL PROTECTED]/private/full"; function logMeIn() { scope = "http://www.google.com/calendar/feeds/"; var token = google.accounts.user.login(scope); } function setupMyService() { var myService = new google.gdata.calendar.CalendarService('exampleCo- exampleApp-1'); logMeIn(); return myService; } function getMyFeed() { myService = setupMyService(); myService.getEventsFeed(feedUrl, handleMyFeed, handleError); } function handleMyFeed(myResultsFeedRoot) { alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText()); insertIntoMyFeed(myResultsFeedRoot); } function handleError(e) { alert("There was an error!"); alert(e.cause ? e.cause.statusText : e.message); } function insertIntoMyFeed(feedRoot) { var newEntry = new google.gdata.calendar.CalendarEventEntry({ authors: [[] { name: "Elizabeth Bennet", email: "[EMAIL PROTECTED]" } ], title: {type: 'text', text: 'Tennis with Darcy'}, content: {type: 'text', text: 'Meet for a quick lesson'}, locations: [[] { rel: "g.event", label: "Event location", valueString: "Netherfield Park tennis court" } ], times: [[] { startTime: google.gdata.DateTime.fromIso8601("2007-12-23T18:00:00.000Z"), endTime: google.gdata.DateTime.fromIso8601("2007-12-23T19:00:00.000Z") } ] } ); feedRoot.feed.insertEntry(newEntry, handleMyInsertedEntry, handleError); } function handleMyInsertedEntry(insertedEntryRoot) { alert("Entry inserted. The title is: " + insertedEntryRoot.entry.getTitle().getText()); alert("The timestamp is: " + insertedEntryRoot.entry.getTimes()[[]0].startTime); } </script> Here's the webpage: http://paginas.fe.up.pt/~ei00073/gcalendar/index.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
