You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Setup the requestif(typeofjQuery!=='undefined'&&jQuery.ajax){varxhr=jQuery.ajax({url: uri2,accepts: {'*': 'text/turtle,text/n3,application/rdf+xml'},processData: false,error: function(xhr,s,e){if(s=='timeout')sf.failFetch(xhr,"requestTimeout");elseonerrorFactory(xhr)(e);},success: function(d,s,xhr){onreadystatechangeFactory(xhr)();}});}else{varxhr=$rdf.Util.XMLHTTPFactory();xhr.onerror=onerrorFactory(xhr);xhr.onreadystatechange=onreadystatechangeFactory(xhr);try{xhr.open('GET',uri2,this.async);}catch(er){returnthis.failFetch(xhr,"XHR open for GET failed for <"+uri2+">:\n\t"+er);}}
With JQuery + usage of a proxy, the onreadystatechangeFactory will not fire the failFetch method which triggers the fail callback hook.
varonerrorFactory=function(xhr){returnfunction(event){if($rdf.Fetcher.crossSiteProxyTemplate&&document&&document.location&&!xhr.proxyUsed){// In mashup situation//// NEVER CALLED: sf.failFetch(xhr, "XHR Error: "+event)// But it seems to re-do the request again but //}else{sf.failFetch(xhr,"XHR Error: "+event)}};}
I think the default RDFLib behavior is to try to fetch the resource without the proxy and if there is an error, try too fetch the resource with the proxy.
I see 2 requestURI calls being triggered but no callback is invoked for the later
Hi.
When using requestURI, it is not always possible to know that there were a failure.
https://github.com/linkeddata/rdflib.js/blob/master/web.js#L1016
With JQuery + usage of a proxy, the onreadystatechangeFactory will not fire the failFetch method which triggers the fail callback hook.
https://github.com/linkeddata/rdflib.js/blob/master/web.js#L693
As expected, the fail hook is correctly triggered when there is a no proxy.
So, when using this method with a proxy, there is no way to know that the request has terminated.
The text was updated successfully, but these errors were encountered: