Here is a sample code for the beforeDisplayContacts
callback.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- | |
Include the script anywhere on your page, usually in the head | |
(don't forget to replace `localhost-only` with your own CloudSponge Widget Key) | |
--> | |
<script src="https://api.cloudsponge.com/widget/localhost-only.js"></script> | |
<script> | |
// variable to hold the complete address book returned from api.cloudsponge.com | |
var complete_address_book; | |
// extra widget options go here: | |
cloudsponge.init({ | |
beforeDisplayContacts:function(contacts, source, owner) { | |
// do something with the contacts array | |
complete_address_book = contacts; | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<a class="cloudsponge-launch">Add from Address Book</a> | |
</body> | |
</html> |