javascript - On click, redirecting to another URL if server slow? -


is possible (in javascript, ajax, other e.g. on client site) redirect user url if first url slow answer (when clicks on link) ?

a href=url1 if no answer server1 after 1 second, redirection url2 (another server)

i thinking on event onclick : redirection url1, timer, redirection url2 if server 1 not responding, code after won't executed...

or using ajax, don't see how

the case ; click on page (a href=urltracking), urltracking redirect url2, urltracking server can slow...

i'm afraid it's not possible in way. can measure response time "timeout check" dummy ajax call, if target url lays in domain. "send test get, if server doesn't respond in xx secs rewrite urls backup sites". it's not suitable general use.


Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -