Last active
July 20, 2016 18:56
-
-
Save dangerouse/1abe913aed2be8feb11a4c5c58789cd0 to your computer and use it in GitHub Desktop.
CloudSponge Widget Reference - Lazy load the widget as needed
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> | |
<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