Skip to content

Instantly share code, notes, and snippets.

@jeffbicca
Last active June 10, 2016 21:08
Show Gist options
  • Save jeffbicca/9b1bfb4e9b852c1b55c41b068c0b8790 to your computer and use it in GitHub Desktop.
Save jeffbicca/9b1bfb4e9b852c1b55c41b068c0b8790 to your computer and use it in GitHub Desktop.
Adjusting indentation.
$("#submitButton").click(function() {
$.ajax({
type : "POST",
url : "api/cart",
contentType : "application/json",
data : JSON.stringify(cartItems),
success : function(data, status, xhr) {
var dataEnc = window.btoa(unescape(encodeURIComponent(JSON.stringify(data))));
$.redirect('/virtual-store/confirm.html', dataEnc);
$('#jsonForm').capture();
$('#jsonForm').submit();
},
error : function(data, status, xhr) {
$('#errors').puidialog('show');
$('#errorMessages')[0].innerHTML = data.responseJSON.error.message;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment