Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

15. Contacts > Removing Contacts

Removing Contacts

To remove an existing contact, an application simply calls the remove method, as shown in the following example:

contact.remove(onContactRemoveSuccess, onContactRemoveError);

The contact object points to an existing contact obtained by creating a new contact via a call to navigator.contacts.create, as described in the beginning of the chapter, or retrieved by searching the local device contacts database using the find method, as described in an earlier section.

The onContactRemoveSuccess and onContactRemoveError parameters passed to the call to remove are callback functions that are executed by the remove method. The onContactRemoveSuccess function is executed after the contact has been successfully removed, while the onContactRemoveError function is the same as the onContactSaveError function described in the first section of this chapter.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial