Skip to content

Instantly share code, notes, and snippets.

@jlev
Created January 11, 2016 20:06
Show Gist options
  • Save jlev/6d4f78aff954f08a3564 to your computer and use it in GitHub Desktop.
Save jlev/6d4f78aff954f08a3564 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="
https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.js" ></script>
<script type="text/javascript" src="http://jvp.callpower.org/api/campaign/4/CallPowerForm.js"></script>
<!-- use CallPowerForm.js instead of embed.js, so we can write our own document.ready handler -->
<style>
.hidden { display: none; }
</style>
</head>
<body>
<h1>Thanks for taking action</h1>
<div id="call_div">
<input type="hidden" id="phone_id" value="6039698711" />
<input type="hidden" id="location_id" value="94612" />
</div>
<script>
jQuery(document).ready(function() {
// override campaign defaults
window.CallPowerOptions = {};
CallPowerOptions.phoneField = jQuery('#phone_id');
CallPowerOptions.locationField = jQuery('#location_id');
CallPowerOptions.scriptDisplay = "overlay";
// bind to call div, which doesn't need to actually be a form
callPowerForm = new CallPowerForm("#call_div", jQuery);
// make call immediately on document.ready
callPowerForm.makeCall();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment