Try something like this:
jQuery(function($){ $('nav a').on('click', function(){ var nv = $(this).text().toLowerCase().replace(/\s+/g, "_"); $.ajax({ type: "POST", url: '<?php echo get_template_directory_uri(); ?>/popupdatapdf.php', data: {valueMin : nv} }).done(function(result) { console.log(result); }); }); });
And open the console to check for errors, as the Networks tab to see that the file popupdatapdf.php really found in the root of the current theme.
source share