Created
October 22, 2012 12:57
-
-
Save kprimdal/3931379 to your computer and use it in GitHub Desktop.
WP: Ajax jQuery
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
$.ajax({ | |
type: 'POST', | |
url: MyAjax.ajaxurl, | |
data: { | |
action: 'action_which_handle_request', | |
pid: $this.attr('data-id') | |
}, | |
success: function(data, textStatus, XMLHttpRequest){ | |
$this.empty().append(data); | |
}, | |
error: function(jqXHR, textStatus, errorThrown) { | |
console.log(errorThrown); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment