Hvordan får man den her til at køre i en Javascript ?
/** Create a contact entry
*/
// Create the contacts service object
var contactsService =
new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0');
// The feed URI that is used to create a contact entry
var feedUri = 'http://www.google.com/m8/feeds/contacts/default/full';
// Create an instance of ContactEntry
var entry = new google.gdata.contacts.ContactEntry();
// Set the name of the contact
entry.setTitle(google.gdata.Text.create('JS-Client: Create Contact'));
// Set the content of the contact
entry.setContent(google.gdata.Text.create('content info here'));
// Create an email instance
var email = new google.gdata.Email();
email.setAddress('JS-Client@domain.com');
email.setPrimary(true);
// Designate this email as the "home" email
email.setRel(google.gdata.Email.REL_HOME);
// Add the email instance
entry.setEmailAddresses([email]);
// The callback method that will be called after a successful insertion from insertEntry()
var callback = function(result) {
PRINT('contact entry created!');
}
// Error handler will be invoked if there is an error from insertEntry()
var handleError = function(error) {
PRINT(error);
}
// Submit the request using the contacts service object
contactsService.insertEntry(feedUri, entry, callback,
handleError, google.gdata.contacts.ContactEntry);
Link til koden:
http://code.google.com/intl/da/apis/contacts/docs/1.0/developers_guide_js.html
