带有AJAX的Javascript

am passing a varible from javascript using ajax to PHP action.But that does not work at all.

function approve(id) {
    var idemail = id;
    $.ajax({
        url: 'http://localhost/feedback/public/index/approve/',
        type: 'POST',
        data: "idemail=" + idemail,
        success: function(data) {
            alert('Approved successfully')
        }
    })

In PHP action

public function approveAction() {
    $approvemail = $_POST['idemail'];
    echo $approvemail;
}

But there is no success response and no echo email also.Please help me.

Your ajax request is correct. It seems the url you are calling isn't understanding the ajax call. Can you check if your application module handles normal and ajax url in different ways. maybe you can try calling simple test url like http://localhost/test.php and check if that works.