Windows 8 JavaScript code examples

Windows 8 JavaScript code examples

As seen from the list, JavaScript is a first-class citizen in the Windows 8 world. For example, dealing with Contacts:

var basketContact = new Windows.ApplicationModel.Contacts.Contact();

var fields = basketContact.fields;

basketContact.name = contact.name;



// Add the emails

appendEmail(fields, contact.homeEmail, Windows.ApplicationModel.Contacts.ContactFieldCategory.home);

appendEmail(fields, contact.workEmail, Windows.ApplicationModel.Contacts.ContactFieldCategory.work);

// ...

There is also an API reference available.