I’m trying to make jQuery’s ajax calls always return as if they succeeded,
e.g. even when I don’t have network, I will return some locally saved data
It that possible?
I tried using the $.ajaxPrefilter and calling the success function of the jqXHR,
but still it won’t behave as if the request has finished 🙁
Thanks!
Well, a quick update: non of the solutions above worked.
What I eventually had to do to walk around this problem, is replace jQuery’s ajax function with my implementation, that checks if there is network connection.
if there is, I proxy the request back to the original ajax function, else, I create the same return structure as ajax’s would and return it
Again, I hate answering my own questions, especially when it’s not really an answer but more of a workaround.
sad…