Need help with why the attached is successfully deleting but not
inserting? Thanks.

<script>
google.load("gdata", "1.x");
google.setOnLoadCallback(getMyFeed);
var aptyp = 1;
var feedUrl = "http://www.google.com/calendar/feeds/default/private/
full";
function setupMyService() {
  var myService =
    new google.gdata.calendar.CalendarService('exampleCo-
exampleApp-1');
  return myService;
}
function getMyFeed() {
        myService = setupMyService();
        searchMyFeed();
}
function searchMyFeed() {
        var myQuery = new google.gdata.calendar.CalendarEventQuery(feedUrl);
        myQuery.setFullTextQuery("Vis 1");
        var callback = function(root) {
                var entries = root.feed.getEntries();
                        if (entries.length > 0) {
                                entries[0].deleteEntry(
                                        function() {
                                        alert('Updated');
                                        },
                                handleError
                        );
            }
        };
myService.getEventsFeed(myQuery,callback);
insertIntoMyFeed();
}
function insertIntoMyFeed() {
  if (aptyp * 1 < 10 ) {
  var newEntry = new google.gdata.calendar.CalendarEventEntry({
    authors: [
      {
        name: "usrnm",
        email: "[EMAIL PROTECTED]"
      }
    ],
    title: {type: 'text', text: "Type: 1"},
    content: {type: 'text', text: "Vis 1"},
    locations: [
      {
        rel: "g.event",
        label: "Event location",
        valueString: "Of 1"
      }
    ],
    times: [
      {
        startTime:
 
google.gdata.DateTime.fromIso8601('2008-01-31T18:00:00.000Z'),
        endTime:
 
google.gdata.DateTime.fromIso8601('2008-01-31T19:00:00.000Z')
      }
    ]
    }
  );
myService.getEventsFeed(feedUrl,function(root)
{root.feed.insertEntry(newEntry);});
};
}
</script>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to