I would like to create a simple "is an url active" validation.

Here is what I have so far:

```
function checkUrl(url) {
    var ok = false;
    $.ajax(
        {
            url: 'http://www.google.com',
            success: function(result) {
                ok = true;
            },
            error: function(result) {
                ok = false;
            },
            async: false
        }
    );
    return ok;
}

```

But it always return false. Note the 'www.google.com' url is there for testing purpose only.