I have a code to display a random quote. One person wrote a function to implement all of this. But the update data via AJAX for some reason does not work. When you press the
Wordpress shortcode same like function where you give parameters,
for creating ajax request you can use jQuery.ajax or xmlhttp in your header or function file with add_action wp_head
hook.
you should create ajax.php in your theme folder and on the top of file you should include wp-load.php. and place all your ajax functions in proper manner.