Check XHR return type appropriately

Asynchronous file XHRs need to listen for onreadystatechange.
This commit is contained in:
Will
2012-09-03 09:52:43 -07:00
committed by Luke Page
parent 6bdd800bb6
commit 5eca0142c9

View File

@@ -239,7 +239,7 @@ function xhr(url, type, callback, errback) {
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
xhr.send(null);
if (isFileProtocol) {
if (isFileProtocol && !less.fileAsync) {
if (xhr.status === 0 || (xhr.status >= 200 && xhr.status < 300)) {
callback(xhr.responseText);
} else {