它总是说您请求的页面无效。 我如何可以获取使用谷歌联系人API 用JavaScript接触本人有效范围和客户端ID使用javascript获取Gmail联系人Google Contacts API
google.load('gdata', '2.x');
debugger
google.setOnLoadCallback(function() {
if (window.location.hash == "") {
if (!checkLogin()) {
logMeIn();
} else {
var feedUrl = "https://www.google.com/m8/feeds/contacts/default/full";
query = new google.gdata.contacts.ContactQuery(feedUrl);
query.setMaxResults(5000);
myService = new google.gdata.contacts.ContactsService('exampleCo-exampleApp-1.0');
myService.getContactFeed(query, function (result) {
document.cookie = "g314-scope-0=";
window.opener.parseGmailContacts(result.feed.entry);
close();
}, function (e) {
alert(e.cause ? e.cause.statusText : e.message);
});
}
}
});
function logMeIn() {
scope = "https://www.google.com/m8/feeds";
var token = google.accounts.user.login(scope);
}
function logMeOut() {
google.accounts.user.logout();
}
function checkLogin() {
scope = "https://www.google.com/m8/feeds/";
var token = google.accounts.user.checkLogin(scope);
return token;
}
我觉得有什么不妥
var token = google.accounts.user.checkLogin(scope);
return token;
令牌retuns“”(空值这里),我怎么能得到令牌的价值获取联系人,PLZ帮助
我觉得有什么不妥 VAR为myService =新google.gdata.contacts.ContactsService( 'exampleCo-ExampleApp中-1.0');这 – TheDean