Skip to content

Instantly share code, notes, and snippets.

@rahularyan
Last active August 29, 2015 14:02
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 rahularyan/c64b8e9a9f1e37777db5 to your computer and use it in GitHub Desktop.
Save rahularyan/c64b8e9a9f1e37777db5 to your computer and use it in GitHub Desktop.
<scrip>
$.ajax({
type:'post',
url : ajax_url,
data: {
action:'hello_ajax'
},
success: function (response) {
consloe.log(responce);
},
});
</script>
<?php
// example of creating ajax action
qw_add_action('qw_ajax_hello_ajax', 'hello_ajax_function');
function hello_ajax_function(){
echo 'Hello! this is ajax responce';
// you must use this at end
die();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment