Vote count:
0
How to return to the calling function (the function above). I would like to return true if the file exists when doing UrlExists('file.png')
:
function UrlExists(url)
{
var http = new XMLHttpRequest();
http.open('HEAD', url, true);
http.onerror = function(e){
//console.log('......onerror: ' + JSON.stringify(e));
if (typeof e !== 'undefined'){
return false
}
};
http.send();
return http.onerror();
}
asked 37 secs ago
How to return to the function calling the current function
Aucun commentaire:
Enregistrer un commentaire