I do not know why it does not show an alert .

I put a break point on my controller and it returns data correctly. In my view it does not show any alert.

my view -

**HTML**:

```
<div class="well pull-right">
    <a id="btn_Pardakht" href="" class="btn btn-general " onclick=" Myfunc();">spend</a>
</div>

```

**JavaScript**:

```
function Myfunc() {

    var url = '@Url.Action("MyAction", "MyController")';
    $.post(url, {
        nam: 'alex'
    }, function (data) {
        if (data)
            alert("success");
        else
            alert("error");
        location.reload();
    });
}

```

my controller:

```
public ActionResult MyAction ( string nam)
{
    var data = new
    {
        sent = true
    };
    return Json(data);    
}

```