Last active
December 23, 2015 03:19
-
-
Save kwhinnery/6572230 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>Parse Cloud Code</title> | |
</head> | |
<body> | |
<!-- redonkulously simple UI --> | |
<input type="text" placeholder="enter phone number"/> | |
<button>Call This Number</button> | |
<!-- jQuery, because jQuery --> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<!-- Include the Parse client-side SDK for JavaScript --> | |
<script src="//www.parsecdn.com/js/parse-1.2.12.min.js"></script> | |
<!-- Execute our Cloud Code function to make an outbound call --> | |
<script> | |
// Initialize with our Parse App ID and JavaScript Key. These are | |
// Found in your app configuration, under the settings tab, in the | |
// "Application keys" section | |
Parse.initialize( | |
'YOUR_PARSE_APP_ID', | |
'YOUR_PARSE_JAVASCRIPT_KEY' | |
); | |
// make a call when our button is clicked | |
$('button').on('click', function() { | |
// Invoke our cloud function, using the phone number in the text field | |
Parse.Cloud.run('makeCall', { | |
to: $('input').val() // the value in the text field | |
}, { | |
// Success handler | |
success: function(message) { | |
alert('Success: ' + message); | |
}, | |
// Error handler | |
error: function(message) { | |
alert('Error: ' + message); | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment