WordPress dies

Admin-ajax.php dies "0" with no processing function

I'm trying to learn how to properly process AJAX requests in Wordpress. To do this, I adapt this tutorial to create a super simple AJAX request to place the ID of a post (from a link) into my page content.

The logic

  1. When the links are clicked [js]
  2. Get the Post ID (from the attribute) and save it as a variable [js]
  3. Pass through an AJAX (using the WP's file) [js]
  4. The function recognizes the ID and simply outputs it [php]
  5. If successful, append the server response to div.

I realize this is of no use, but once I have this work I will be changing the function to serve a real purpose.

My code

Here is a copy of the function I made in the plugins folder:

And here is a copy of the JS file

The problem

Clicking the link will trigger the JS but give the following response:

Using a warning message that I know the id will be fetched before the AJAX request. So the problem lies in my role. To find out more, I (temporarily) optimized WP's file to find out which gave the answer "0".

It's the very last thing in the file that I thought wouldn't fire because I have a command in my own function. Can someone please tell me where I am wrong?