incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse MacFadyen (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CB-157) Contacts API: contacts.find returns an array of unparsed contacts in JSON
Date Wed, 27 Jun 2012 16:58:44 GMT

     [ https://issues.apache.org/jira/browse/CB-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jesse MacFadyen closed CB-157.
------------------------------

    
> Contacts API: contacts.find returns an array of unparsed contacts in JSON
> -------------------------------------------------------------------------
>
>                 Key: CB-157
>                 URL: https://issues.apache.org/jira/browse/CB-157
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.3.0
>            Reporter: Abu Obeida Bakhach
>            Assignee: Jesse MacFadyen
>            Priority: Critical
>              Labels: features
>             Fix For: 1.4.0
>
>
> This code is supposed to work:
>   var options = new ContactFindOptions();
>   options.multiple = true;
>   navigator.contacts.find(["displayName"], onSuccess, onError, options);
>   function onSuccess(contacts) {
>       for (var i = 0; i < contacts.length; i++) {
>           console.log(contacts[i].displayName);
>       }
>   }
> But it doesn't. You have to call JSON.parse on each contact to convert it into a JavaScript
object:
>   var options = new ContactFindOptions();
>   options.multiple = true;
>   navigator.contacts.find(["displayName"], onSuccess, onError, options);
>   function onSuccess(contacts) {
>       for (var i = 0; i < contacts.length; i++) {
>           var contact = JSON.parse(contacts[i]);
>           console.log(contact.displayName);
>       }
>   }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message