Mercurial > hg > batmud > gmap2
diff lib/util.js @ 267:96ce03724648 gmap2
Add error handler callback.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 13 Apr 2014 21:23:07 +0300 |
parents | 5a433ea98f76 |
children | 585a8fb4a286 |
line wrap: on
line diff
--- a/lib/util.js Sun Apr 13 20:55:50 2014 +0300 +++ b/lib/util.js Sun Apr 13 21:23:07 2014 +0300 @@ -14,7 +14,7 @@ } -function XDownloadUrl(url, callback) +function XDownloadUrl(url, callback, errcallback) { var status = -1; var request = XCreateXmlHTTPRequest(); @@ -36,6 +36,9 @@ callback(request.responseText, request.status); request.onreadystatechange = function() {}; } + else + if (typeof(errcallback) == "function") + errcallback(status); } }