Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Last active October 15, 2015 16:42
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 Dinamiko/13903aa4616f59bf4d3b to your computer and use it in GitHub Desktop.
Save Dinamiko/13903aa4616f59bf4d3b to your computer and use it in GitHub Desktop.
$( "#form-encuesta" ).submit(function(e) {
e.preventDefault();
if( form.valid() ) {
jQuery.ajax({
type : 'post',
dataType : 'json',
url : ajaxurl,
data : {
action: 'encuesta_ajax',
},
success: function( response ) {
if( response.type == 'success') {
console.log( 'ok: ' + response.msg );
} else {
console.log( 'error: ' + response.msg );
}
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment