Skip to content

Instantly share code, notes, and snippets.

@aribeiro
Last active July 26, 2017 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aribeiro/197dab5150d8577594aeb9bf360b1c05 to your computer and use it in GitHub Desktop.
Save aribeiro/197dab5150d8577594aeb9bf360b1c05 to your computer and use it in GitHub Desktop.
CloudSponge Widget Reference - Display Phone Column and filter contacts with phone number
<!DOCTYPE html>
<html>
<body>
<!--
Include the script anywhere on your page, usually in the head
(don't forget to replace YOUR_WIDGET_SCRIPT with your CloudSponge key)
-->
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script>
<script>
cloudsponge.init({
// set the phone column to be display
displayContactsColumns: ["email", "phone"],
// Set the filter to only show contacts with phone numbers
filter: function(contact){
return contact.phone.length > 0 || contact.email.length > 0;
}
});
</script>
<textarea class="cloudsponge-contacts"></textarea>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment