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