Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BAF279F7D for ; Thu, 5 Jan 2012 22:42:02 +0000 (UTC) Received: (qmail 20270 invoked by uid 500); 5 Jan 2012 22:42:02 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 20227 invoked by uid 500); 5 Jan 2012 22:42:02 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 20218 invoked by uid 99); 5 Jan 2012 22:42:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2012 22:42:01 +0000 X-ASF-Spam-Status: No, hits=-2001.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2012 22:42:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8408E13A476 for ; Thu, 5 Jan 2012 22:41:40 +0000 (UTC) Date: Thu, 5 Jan 2012 22:41:40 +0000 (UTC) From: "Abu Obeida Bakhach (Created) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1401140163.12002.1325803300542.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (CB-157) Contacts API: contacts.find returns an array of unparsed contacts in JSON MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 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 Callback Issue Type: Bug Components: WP7 Affects Versions: 1.3.0 Reporter: Abu Obeida Bakhach Assignee: Jesse MacFadyen Priority: Critical 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