Tag: google contacts

如何从$ .get jquery更新angularjs $ scope?

我试图使用以下代码并使用$scope : var scopes = “https://www.googleapis.com/auth/contacts.readonly”; setTimeout(authorize(), 20); function authorize() { gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: false}, handleAuthorization); } invitePeersController.gmailContacts = []; function handleAuthorization(authorizationResult) { if (authorizationResult && !authorizationResult.error) { $.get(“https://www.google.com/m8/feeds/contacts/default/thin?alt=json&access_token=” + authorizationResult.access_token + “&max-results=50000&v=3.0”, function(response){ //process the response here console.log(response); var jsonChildData = JSON.parse(JSON.stringify( response.feed.entry)); for(var i=0; i<jsonChildData.length;i++){ try { var item = {}; […]

如何通过JavaScript管理Google帐户的联系人?

我正在尝试通过JavaScript程序管理Google帐户联系人。 当我尝试通过JavaScript删除联系人时,会出现此错误:“网络错误:405不允许的方法”。 这是我的代码: function deleteContacts() { $.ajax({ type: ‘DELETE’, url: ‘https://www.google.com/m8/feeds/contacts/default/full/{client_Id}?access_token=’ + tokenId, headers: { ‘If-Match’: ‘*’, ‘Gdata-version’: ‘3.0’ }, dataType: ‘jsonp’, data: {}, success: function (data) { console.log(“response: ” + data) } }); } 请帮助我,这可以通过JavaScript管理Google帐户的联系人吗? 如果真的有可能请告诉我管理Google帐户联系人的所有可能性…. 有没有其他JavaScript API可用? 有替代解决方案吗? 我知道谷歌已经在java,PHP,节点中列出了解决方案,我在Nodejs中编写服务器代码,但似乎是Alpha版本中NodeJs的谷歌客户端代码,不知道管理联系人有多强大…