Skip to content

Instantly share code, notes, and snippets.

@fairchild
Last active August 29, 2015 13:58
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 fairchild/10142281 to your computer and use it in GitHub Desktop.
Save fairchild/10142281 to your computer and use it in GitHub Desktop.
super simple m2x api example
<!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