I am making an ajax call to a php file on my server.
That php file retrieves some info from various websites, so an ajax call can take 30 seconds to complete in the worst case.
All I want to do is to set a timeout value for the ajax call and to trigger a function when timeout is reached.
I think jQuery .complete is what I am looking for since it is called in any case but how to detect if it is called on timeout?
Actually, you can use
.errorfor that instead of.complete.textStatuswill be “timeout”.