I am wondering why - google.accounts.user.checkLogin(scope) always
returns null am I never get logged in?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="verify-v1"
content="0cON1PImRKuCO0wUUGq9o4H395CF7LXzSA8+IGLonWs=" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://www.google.com/jsapi?
key=ABQIAAAAZSbNzP7r084-
OAMcq8XIFBS9D4KrKJKvz9TiuPOPu_pU8i6euhRLiCMoBahxJ9hLKNSrDkoD7551PQ"></
script>

<script type="text/javascript">
google.load("gdata", "1");

var scope = "http://www.google.com/calendar/feeds/";;
google.setOnLoadCallback(getMyFeed);




function authSubRequest() {
   var url = 'https://www.google.com/accounts/AuthSubRequest?';
    url += 'scope=' + scope;
    url += '&session=1&secure=0&';
    url += 'next=' + "http://www.jbampton.com/gc1.html";;

    window.location = url;
        token = getUrlParam('token');
        document.cookie = 'g314-http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds
%2F=' + token;
}

function doAuthSub(){
        authSubRequest();
}

function getMyFeed(){
        var calendarService = new google.gdata.calendar.CalendarService
('GoogleInc-jsguide-1.0');
        //alert(google.accounts.user.checkLogin(scope));
        if ( google.accounts.user.checkLogin(scope) == null) {
                doAuthSub();
        }



        if (google.accounts.user.checkLogin(scope)) {

                alert("jfaosdf");
                // The default "private/full" feed is used to insert event to 
the
                // primary calendar of the authenticated user
                var feedUri = 
'http://www.google.com/calendar/feeds/default/private/
full';

                // Create an instance of CalendarEventEntry representing the new
event
                var entry = new google.gdata.calendar.CalendarEventEntry();

                // Set the title of the event
                entry.setTitle(google.gdata.Text.create('JS-Client: insert 
event'));

                // Create a When object that will be attached to the event
                var when = new google.gdata.When();

                // Set the start and end time of the When object
                var startTime = google.gdata.DateTime.fromIso8601
("2009-05-10T09:00:00.000-08:00");
                var endTime = google.gdata.DateTime.fromIso8601
("2009-05-10T10:00:00.000-08:00");
                when.setStartTime(startTime);
                when.setEndTime(endTime);

                // Add the When object to the event
                entry.addTime(when);

                // The callback method that will be called after a successful
insertion from insertEntry()
                var callback = function(result) {
                  alert('event created!');
                }

                // Error handler will be invoked if there is an error from
insertEntry()
                var handleError = function(error) {
                  alert(error);
                }

                // Submit the request using the calendar service object
                calendarService.insertEntry(feedUri, entry, callback,
                        handleError, google.gdata.calendar.CalendarEventEntry);

        }

}


</script>

</head>

<body>

        <img style="position:absolute; top: 10px;" src="1.jpeg" />


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

Reply via email to