Skip to content

Instantly share code, notes, and snippets.

@dangerouse
Last active August 29, 2015 14:10
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/10f191bad249937b022f to your computer and use it in GitHub Desktop.
Save dangerouse/10f191bad249937b022f to your computer and use it in GitHub Desktop.
CloudSponge Widget - Launch from a div instead of an anchor
<!DOCTYPE html>
<html>
<head>
<script>
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
a.async=1;a.src=u;m.parentNode.insertBefore(a,m);
})('//api.cloudsponge.com/widget/YOUR_WIDGET_SCRIPT.js');
</script>
</head>
<body>
<div id="csLaunch">Add from Address Book</div>
<textarea id="contact_list"></textarea>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script type='text/javascript'>
window.csPageOptions = {
textarea_id:'contact_list'
};
$(function(){
$('#csLaunch').click(function(){
cloudsponge.launch();
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment