POST method return undefined value, but GET method working fine. I even tried $.post(url, data, success); << $.post even worse GET and POST can't work.
<input type="submit" value="submit" id="btnUpload">
$('#btnUpload').click(function(){
$.ajax({
type: 'POST',
url: 'ajax.php',
data: { 'action': 'scan_email' },
success: function(response) {
alert(response);
}
});
ajax.php
<?php echo $_POST['action'];?>