mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Check XHR return type appropriately
Asynchronous file XHRs need to listen for onreadystatechange.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user