Ajax request sends url rather than data

Some Notes

  1. You shouldn’t use anonymous/lambda fn, closures for hooks – Those can’t get unregistered.
  2. Create your nonces, when localizing the script – See for ex. this answer.
  3. The ajaxurl isn’t set by default. You’ll have to define it (and let it point to admin-ajax.php) when localizing the script. Then you access it via the localized object (the 2nd argument inside wp_localize_script()) like this: your_obj_name.ajaxurl.

You should also take a look at the Codex article about Ajax in Plugins.