what is the correct way to determine that an AJAX call is successful? 

I see in prototype.js

```
    return !status || (status >= 200 && status < 300);

```

and in jQuery:

```
    // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
    return !xhr.status && location.protocol == "file:" ||
        ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;

```

which one is correct? If we don't use any Javascript library but write the AJAX in basic Javascript, which one should we use?