I thought I could do an unauthorized request since there is an example
on the Javascript API page.

I included the "google.accounts.user.login(feedUrl) and granted access
to the application, but it is still continuing to load after the page
is finished.

In firebug, the console says the the calendar feed connection is "keep-
alive". Could this be the reason for the non-stop loading? I added a
init function which is only used at the end in a
"google.setonloadcallback" as is shown in the example.

On Oct 2, 12:34 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
> Hi BJ,
>
> The first problem that I notice from your snippet is that you never
> establish authentication for your JavaScript app.  You need to invoke
> google.accounts.user.login(feedUrl) before you start using the
> JavaScript API.  For more details information please go to
>
> http://code.google.com/apis/calendar/developers_guide_js.html
>
> You may also check out one of our sample apps using the Calendar Data
> Javascript API here:
>
> http://gdata-javascript-client.googlecode.com/svn/trunk/samples/calen...
>
> Austin
>
> On Oct 1, 7:07 pm, BJ <[EMAIL PROTECTED]> wrote:
>
> > The Javascript:
>
> > (Included in the Header):
> >     <script src="http://www.google.com/jsapi?key=ABQIAAAAnzlJ_K-6-
> > LcYqmwwsJBMTRSUK_tL3-qjETKn5smHuE8b6GF0kxSXcxYKZpkecfnPthfwG-7ld--dHQ"
> > type="text/javascript"></script>
>
> > <script type="text/javascript>
> > //<![CDATA[
>
> > google.load("gdata", "1");
>
> > var feedUrl =
> >   "http://www.google.com/calendar/feeds/[EMAIL PROTECTED]/public/
> > full";
>
> > function padNumber(num) {
> >   if (num <= 9) {
> >     return "0" + num;
> >   }
> >   return num;
>
> > }
>
> > function setupMyService() {
> >   var myService =
> >     new google.gdata.calendar.CalendarService('exampleCo-
> > exampleApp-1');
> >   return myService;
>
> > }
>
> >         function searchMyFeed() {
> >           myService = setupMyService();
> >           var myQuery = new
> > google.gdata.calendar.CalendarEventQuery(feedUrl);
> >           myQuery.setMaxResults(10);
> >           myService.getEventsFeed(myQuery, handleMyQueryResults,
> > handleError);
> >         }
>
> >         function handleMyQueryResults(myResultsFeedRoot) {
> >         var len = myResultsFeedRoot.feed.getEntries().length;
> >         document.write("There are" + len + "results <br>");
> >                 for (var j=1; j < 31; j++)
> >                 {
> >                         document.write('<div id="'+ j + '" 
> > class="day">September '+ j);
> >                         for (var i = 0; i < len; i++){
> >                                 var entry = 
> > myResultsFeedRoot.feed.getEntries()[i];
>
> >                                 /* Time Formatting */
> >                                 var times = entry.getTimes();
> >                                 if (times.length > 0) {
> >                                         startDateTime = 
> > times[0].getStartTime();
> >                                         startJSDate = 
> > startDateTime.getDate();
> >                                         }
> >                                 var dateString = (startJSDate.getMonth() + 
> > 1) + "/" +
> > startJSDate.getDate();
> >                                         if (!startDateTime.isDateOnly()) {
> >                                         dateString += " " + 
> > startJSDate.getHours() + ":" +
> > padNumber(startJSDate.getMinutes());
> >                                         }
> >                                 var dateOnly = (startJSDate.getMonth() + 1) 
> > + "/" +
> > startJSDate.getDate();
> >                                 /* [/Time Formatting] */
>
> >                                         if(dateOnly == ("9/" + j))
> >                                         {
> >                                         document.write("# "+ (i+1) +"'s 
> > search-match entry's title
> > is: " + entry.getTitle().getText() + " on " + dateString + "<br>");
> >                                         }
> >                                 //}
> >                         }
> >                         document.write('</div>');
> >           /*else {
> >             document.write("There are no entries that match the search
> > query.");
> >           }*/
> >                 }
> >         }
>
> >         function handleError(e) {
> >           alert("There was an error!");
> >           alert(e.cause ? e.cause.statusText : e.message);
> >         }
>
> > //]]>
> > </script>
>
> > And is then called in the body:
> >         <script type="text/javascript" charset="utf-8">
> >                 searchMyFeed();
> >         </script>
>
> > On Oct 1, 4:43 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > Hi BJ,
>
> > > Would you post a snippet of the Javascript code to the forum? We could
> > > see if there is anything that is causing this issue
>
> > > Austin
>
> > > On Sep 30, 12:24 pm, BJ <[EMAIL PROTECTED]> wrote:
>
> > > > I'm trying to list events in a calendar format with separate divs for
> > > > each day and the events relevant to that day printed in the
> > > > appropriate box. For some reason, the boxes are not appearing and the
> > > > request seems to go on infinitely.
>
> > > >http://bjtitus.net/calTest/
>
> > > > I'm new to this, so I don't know much about the whole Data API.
> > > > Everytime I have tried to make a query with the API it seems to loop
> > > > infinitely so it must be something I'm doing wrong.
>
> > > > Thanks for your help!- Hide quoted text -
>
> > - Show quoted text -


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