Hi, I made a few correction to your script (it's pasted below). But the main problem I see from your code is that you should use google.setLOnLoadCallback() to initiate all the processing rather than using the onload from the BODY.
<html> <head> <script type="text/javascript" src=" http://www.google.com/jsapi?key=ABQIAAAACNciPTmDCjE1_9RvQBjjchRneDYLKsC206mjtCIaAEgA4swSsRRPm2hLXAyB0pMy9k5VAYBXcmyt4Q "> </script> <script> google.load('gdata', '1.x'); google.setOnLoadCallback(getMyFeed); var appt = 'test appointment'; var pat = 'test pat'; var office = 'test location'; var feedUrl = "http://www.google.com/calendar/feeds/default/private/full"; function logMeIn() { scope = "http://www.google.com/calendar/feeds/"; if (!google.accounts.user.checkLogin(scope)) { 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, insertIntoMyFeed,handleError); } function insertIntoMyFeed(feedRoot) { var newEntry = new google.gdata.calendar.CalendarEventEntry({ authors: [ { name: "Warren", email: "[EMAIL PROTECTED]" } ], title: {type: 'text', text: appt}, content: {type: 'text', text: "pat id: " + pat}, locations: [ { rel: "g.event", label: "Event location", valueString: office } ], times: [ { startTime: google.gdata.DateTime.fromIso8601("2008-01-31T13:00:00.000Z"), endTime: google.gdata.DateTime.fromIso8601("2008-01-31T15:00:00.000Z") } ] } ); feedRoot.feed.insertEntry(newEntry, function() {alert('event inserted');}, handleError); } function handleError(e) { alert("There was an error!"); alert(e.cause ? e.cause.statusText : e.message); } </script> </head> <body> <IMG style='visibility: hidden;' src="images/sb.bm"> </body> </html> On Jan 30, 2008 8:44 AM, warrenjb <[EMAIL PROTECTED]> wrote: > > This code worked fine and inserted an event in my calendar last week > but for some reason no longer works? There is no error when it runs > but there is no event entered into the calendar either. Anyone know > what may have happened? > > <html> > <head> > <script type="text/javascript" > src="http://www.google.com/jsapi? > > key=ABQIAAAACNciPTmDCjE1_9RvQBjjchRneDYLKsC206mjtCIaAEgA4swSsRRPm2hLXAyB0pMy9k5VAYBXcmyt4Q > "> > </script> > <script> > google.load("gdata", "1"); > </script> > <script> > var appt = 'test appointment'; > var pat = 'test pat'; > var office = 'test location'; > > 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, insertIntoMyFeed,handleError); > } > function insertIntoMyFeed(feedRoot) { > var newEntry = new google.gdata.calendar.CalendarEventEntry({ > authors: [ > { > name: "Warren", > email: "[EMAIL PROTECTED]" > } > ], > title: {type: 'text', text: appttype}, > content: {type: 'text', text: "pat id: " + pat}, > locations: [ > { > rel: "g.event", > label: "Event location", > valueString: office > } > ], > times: [ > { > startTime: > > google.gdata.DateTime.fromIso8601("2008-01-31T13:00:00.000Z"), > endTime: > > google.gdata.DateTime.fromIso8601("2008-01-31T15:00:00.000Z") > } > ] > } > ); > feedRoot.feed.insertEntry(newEntry,handleError); > } > function handleError(e) { > alert("There was an error!"); > alert(e.cause ? e.cause.statusText : e.message); > } > </script> > </head> > <body onload="getMyFeed()"> > <IMG src="images/sb.bmp"> > </body> > </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 -~----------~----~----~----~------~----~------~--~---
