On Wednesday, December 18, 2013 4:37:21 PM UTC+1, Julien Wajsberg wrote:
> All you can use is documented in the WebIDL [1]. If it's not there it's
> 
> not there ;)
> 
> That said, JSON.stringify(contact) works well IIRC.
> [1]
> 
> https://mxr.mozilla.org/mozilla-central/source/dom/webidl/Contacts.webidl

Thanks Julien, I will have a look into the code.

After I manually created a contact with a given name and family name I ran the 
following:

function getContact() {
  var filter = {
    filterBy: ['id'],
    filterValue: 'bca17bc5889f0d468ff50c18039b5e4c',
    filterOp: 'equals'
  };
  var request = window.navigator.mozContacts.find(filter);
  request.onsuccess = function () {
    console.log(JSON.stringify(this.result));
  };
}

However the output is just:

"[{"id":"bca17bc5889f0d468ff50c18039b5e4c"}]"

Same with mozContacts.getAll(). That's not such a big problem though.
I know how to get all values. But it's rather awkward.

Kai
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to