I need a way to set some kind of timeout function globally with $.ajaxSetup that will allow my Phonegap application to keep retrying an ajax GET or POST every time there is a timeout due to a bad internet connection.
I use Backbone.js so most jquery plugins won't work for this, I would some help writing one global piece of code which will handle retries.
Thank you.
You can use jQuery.ajaxSetup(options).
Example
Apart from that if you want perform call again on timeout, I will suggest you to create wrapper for ajax call like.
And Use the function just like
$.ajax
Found a solution to make all AJAX calls work with a retry timeout.