We run our application on partners websites using widgets under async iframes.
One of our servers is unreachable from some networks, and some users are claiming about continuous "Loading from our.domain.com ...", causing direct interference on user experience.
It is possible to abort resource loading when network error occurs?
Our environment cannot depends of any external lib (like jquery, zepto, ...). Our code is written in raw javascript.
We tried to remove javascript element after some timeout, like described on some resources here on SO, but no one works.
Here, is one snippet of testing code. This removes <script> element after 1s if it is not ready.
setTimeout(
function(){
//Check if it is ready using a control var
if (! contextControl.isReady){
// Not Ready
var trgt = document.getElementById("element-id");
//force element drop
trgt.parentNode.removeChild(trgt);
}
}, 1000
);
It removes javascript element effectively, but doesn't abort resource loading.
There is some effective way to abort this resource loading?