Last active
August 29, 2015 13:58
-
-
Save fairchild/10142281 to your computer and use it in GitHub Desktop.
super simple m2x api example
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> | |
<head> | |
</head> | |
<body> | |
<form id='m2xform' action="#"> | |
<input name='m2xApiKey' placeholder='m2x api key' value='3fef5d69c3a7eab559b733ba854baef1' > | |
</form> | |
<pre id='m2xexample'>m2x</pre> | |
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="scripts/vendor/m2x-javascript/m2x-0.4.0.js"></script> | |
<script type="text/javascript"> | |
$(document).ready( function(){ | |
$('#m2xform').submit(function(event) { | |
event.preventDefault(); | |
var m2x = new M2X($('#m2xApiKey')); | |
console.debug(event); | |
m2x.status(function(status) { | |
console.debug(status); | |
$('#m2xexample').html(JSON.stringify(status)); | |
}); | |
}) | |
}); | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment