Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8839861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:19:56+00:00 2026-06-14T10:19:56+00:00

I am using contact.find function to get emails from contact list. getting all contactlist

  • 0

I am using contact.find function to get emails from contact list.
getting all contactlist names is fine but I am stuck from getting contactlist emails.
it seems javascript error occurs when I parse email data from contactlist.

below is my code.

var contactFxn = {

getContact : function(){
    var options = new ContactFindOptions();
    var fields = ["name", "email"];
    options.filter= "";
    options.multiple=true;
    navigator.contacts.find(fields, this.onSuccess, this.onError, options);
    //console.log(options);
},
onSuccess : function(contacts){

    for(var i = 0; i < contacts.length; i++){
            console.log(i);
            console.log("Display email = " + contacts[i].emails[0].value);
        }  
    }
},
onError : function(e){
    console.log(e);
}

}

contactFxn.getContact();

and here is my log console.

2012-11-09 16:48:22.564 test[9529:907] [LOG] 0
2012-11-09 16:48:22.566 test[9529:907] [LOG] Display Name = ssxxc
2012-11-09 16:48:22.568 test[9529:907] [LOG] 1

I am guesssing webview throws javascript error when contact does not have any email value.
It is too bad that I can’t check what type of javascript error occured in xcode.

I already tried ‘if(contacts[i].emails[0] == null)’ but no luck. webview throws error anyway
can anybody suggeust other ways to fix this problem? thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:19:58+00:00Added an answer on June 14, 2026 at 10:19 am
    onSuccess : function(contacts){
    
    for(var i = 0; i < contacts.length; i++){
            console.log(i);
            if(contacts[i].emails){
                console.log("Display email = " + contacts[i].emails[0].value);
            }
        }  
    }
    

    just stupid mistake.

    I tried to get contacts[i].emails[0].value while some elements of contacts array

    does not have emails value. above code works fine now

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all I am trying to get contact information from the contact database using
I am using following code, copied from a website, for a contact page. But
I made an app using contact sync. I list the following contact info with
Hi I'm using contact form 7 with Really Simple CAPTCHA, but it's throwing up
Alright, I'm just trying to learn about using Contact information, but I'm a bit
I am using grouped tableview for developing a contact list using database. I have
via server API's i'm getting contact information using member of structure: char displayName[USERNAME_MAX_SIZE]; One
I have a mail_merge function (using cakephp) which when called directly from the browser
If I have an example function ... function foo() { # get a list
I am attempting to get the list value through a jquery function attached to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.