Skip to content

Instantly share code, notes, and snippets.

@klhall1987
Last active October 19, 2016 13:34
Show Gist options
  • Save klhall1987/02e23b3d92947a825e146702329ca851 to your computer and use it in GitHub Desktop.
Save klhall1987/02e23b3d92947a825e146702329ca851 to your computer and use it in GitHub Desktop.
Force SSL Fix
jQuery.ajax({
url: nfFrontEnd.adminAjax,
type: 'POST',
data: data,
cache: false,
xhrFields: { withCredentials: true },
success: function( data, textStatus, jqXHR ) {
try {
var response = jQuery.parseJSON( data );
nfRadio.channel( 'forms' ).trigger( 'submit:response', response, textStatus, jqXHR, formModel.get( 'id' ) );
nfRadio.channel( 'form-' + formModel.get( 'id' ) ).trigger( 'submit:response', response, textStatus, jqXHR );
} catch( e ) {
console.log( 'Parse Error' );
}
},
error: function( jqXHR, textStatus, errorThrown ) {
// Handle errors here
console.log('ERRORS: ' + textStatus);
// STOP LOADING SPINNER
nfRadio.channel( 'forms' ).trigger( 'submit:response', 'error', textStatus, jqXHR, errorThrown );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment