diff --git a/src/httpVueLoader.js b/src/httpVueLoader.js index 9bb2d9f..3b9565c 100644 --- a/src/httpVueLoader.js +++ b/src/httpVueLoader.js @@ -448,11 +448,20 @@ xhr.onreadystatechange = function() { if ( xhr.readyState === 4 ) { - - if ( xhr.status >= 200 && xhr.status < 300 ) + + if ( (xhr.status >= 200 && xhr.status < 300)) resolve(xhr.responseText); - else - reject(xhr.status); + else { + try{ + // fix for phonegap status + if(cordova !== 'undefined' && xhr.status === 0 && xhr.responseText !== '') + resolve(xhr.responseText) + else + reject(xhr.status); + } catch (e){ + reject(xhr.status); + } + } } };