Skip to content

Instantly share code, notes, and snippets.

@dangerouse
Last active July 20, 2016 18:56
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 dangerouse/1abe913aed2be8feb11a4c5c58789cd0 to your computer and use it in GitHub Desktop.
Save dangerouse/1abe913aed2be8feb11a4c5c58789cd0 to your computer and use it in GitHub Desktop.
CloudSponge Widget Reference - Lazy load the widget as needed
<!DOCTYPE html>
<html>
<body>
<script>
// statically declare your cloudsponge options *before* including your widget script
window.csPageOptions = {
// you can set your configuration options here
// ...
// setting lazyLoad to true will delay loading the cloudsponge object
// you must call cloudsponge.load() before any interaction with the widget
// NB: lazyLoad is ignored after consent is provided in the inlineOauth flow
lazyLoad: true
};
</script>
<!--
Include the script anywhere on your page, usually in the head
(don't forget to replace `localhost-only` with your CloudSponge key)
-->
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script>
<!-- This simple example lets you click a link to load the cloudsponge object -->
<a href="#" onclick="cloudsponge.load()">Load Widget!</a>
<a class="cloudsponge-launch">Add from Address Book</a>
<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