Why can't I access my Ajax data?

				
					add_action( 'wp_head', function () { ?>
<script type="text/javascript">
var ajaxurl = "<?php echo admin_url('admin-ajax.php'); ?>";
</script>
<?php } );