Question: ```
   function ajaxRefresh(actionUrl) {
        $.ajax({
        url: actionUrl,
        success: function() {
             return true;
        }});
        return false;
    }

```

The function anyway returns `false` even when a request is succeeded, becouse the request is asynchronous. How I can return `true` when request is succeeded?

Answer: 
I am a relatively newbie at this, but here is a suggested work around I came up with which eliminates the need to set `asynch` to false or anything like that. Just set a hidden field value with the result of the ajax call, and instead of checking return value, check the value of the hidden field for true/false (or whatever you want to put in it).

Example:
 function doSomething() {

```
    $.ajax({
        ...blah blah 
        },
        success: function(results) {
            if(results === 'true') {
                $('#hidField').val('true');
            }
            else {
                $('#hidField').val('false');
            }
        }
    });

```

Then somewhere else where it's required, this `doSomething` function is called, and instead of checking the result of the ajax call, look for the hidden field value:

```
doSomething();

var theResult = $('#hidField').val();

if (theResult == 'true') {

...do whatever...

}

```
```
function ajaxRefresh(actionUrl) {   
    bool isSucesss=false;
    $.ajax({       
        url: actionUrl,        
        success: function() {   
            isSucesss=true;     
        },
        error:function() {   
            isSucesss= false;     
        }
    });     
    return isSucesss;
}

```