I'm trying to mock a timeout from a webpage so that I can implement a "deal with timeout" feature.
Basically what I need is a URL of something that does not reply within X seconds.
Thanks in advance
Here's the code I have:
var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
req.overrideMimeType('text/plain; charset=utf-8');
req.open("GET", configurationURL, false);
req.variable = specificConfigurationURLTerminator;
setTimeout(function() {
alert("aborting");
req.abort();
}, this.configurationRetrievalTimeout);
req.send(null);
Guys thank you so much for your prompt replies. I've found what I was looking for:
http://www.google.com:81/
basically doesn't respond not even with an error =) exactly what I need to trigger a timeout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With