4 messages in com.googlegroups.google-calendar-help-dataapiRe: Developers Guide JS code not working| From | Sent On | Attachments |
|---|---|---|
| open...@gmail.com | 13 Dec 2007 19:13 | |
| Austin (Google) | 13 Dec 2007 19:35 | |
| open...@gmail.com | 13 Dec 2007 20:47 | |
| open...@gmail.com | 13 Dec 2007 20:56 |
| Subject: | Re: Developers Guide JS code not working![]() |
|---|---|
| From: | open...@gmail.com (open...@gmail.com) |
| Date: | 12/13/2007 08:47:37 PM |
| List: | com.googlegroups.google-calendar-help-dataapi |
Hey Austin, thank you very much.
(In fact, the problem was the extra []).
But it just helped a bit since now the script keeps asking for authentication and never inserts the entry!
You can try it in: http://paginas.fe.up.pt/~ei00073/gcalendar/index.html
If I comment the logMeIn() function as try the URL+token:
It gives me the title of the feed but it doesn't insert the entry asking for authentication.
I don't know what to do.
Thanks
On Dec 14, 3:36 am, "Austin (Google)" <api....@google.com> wrote:
Hi,
One of the first problem I noticed is the inclusion of all the "[]" within all array bracket. I believe you copy the source code directly from "view source". The extra "[]" are inserted because of the templating system we use, and it is not intended to be the actual code. Try removing them to see if it works.
Austin
On Dec 13, 2007 7:14 PM, open...@gmail.com <
open...@gmail.com> wrote:
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/ open...@gmail.com/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: "l....@gmail.com" } ], 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>




