This maybe can help to fixed the problem.

Request via script load timed out. Possible causes: feed URL is
incorrect; feed requires authentication
If this error is oocure during your running the program, you better
use checkLogin() function before you do the getMyContacts() function.

the script will be like this:

var contactsService;

function setupContactsService()
{
  contactsService = new google.gdata.contacts.ContactsService('Google-
PickerSample-1-0');
}

function logMeIn()
{
  var scope = 'http://www.google.com/m8/feeds/';
  var token = google.accounts.user.login(scope);
}

function initFunc()
{
  //window.alert("Testing");
  setupContactsService();
  logMeIn();
  if(google.accounts.user.checkLogin(token))--> this line will fixed
the error like mentioned above!!!!!
  {
        getMyContacts();
  }
}

function logMeOut()
{
  google.accounts.user.logout();
}

function getMyContacts()
{
  var contactsFeedUri = 'http://www.google.com/m8/feeds/contacts/
default/full';
  var query = new google.gdata.contacts.ContactQuery(contactsFeedUri);
   //window.alert("Kontak");
  // Set the maximum of the result set to be 5
  query.setMaxResults(5);

  contactsService.getContactFeed(query, handleContactsFeed,
handleError);
}

var handleContactsFeed = function(result) {

  var entries = result.feed.entry;

  for (var i = 0; i < entries.length; i++) {
    var contactEntry = entries[i];
    var emailAddresses = contactEntry.getEmailAddresses();

    for (var j = 0; j < emailAddresses.length; j++) {
      var emailAddress = emailAddresses[j].getAddress();
      PRINT('email = ' + emailAddress);
    }
  }
}

var handleError = function(e) {
  //alert("There was an error!");
  alert(e.cause ? e.cause.statusText : e.message);
}

//google.setOnLoadCallback(initFunc);
google.load('gdata', '2.0');

Hope this can help your problem.
Thanks

--

You received this message because you are subscribed to the Google Groups 
"Google Contacts 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-contacts-api?hl=en.


Reply via email to