$.ajaxSetup({timeout:15000}); does not seem to work with jQuery.getJSON. What am I doing wrong?
My code is:
function logInJS(fields, dv) { // VARs defined here are visible in callback
var elem = document.getElementById(fields);
var dvD = dv;
$.ajaxSetup({timeout:15000}); // milliseconds of timeout
jQuery.getJSON(baseURL + 'json?verb=6', $(elem).serialize(),
function(data, status, xhr) {
if (data.msg) {
alert(data.msg);
} else {
This works fine when the server is running. Status is "success" and xhr.status is 200 as expected. When I turn the server off so that there will never be a reply, however, the timeout doesn't seem to fire.
As I read the documentation, this was supposed to set a timeout for all ajax calls and getJSON was supposed to create an ajax call eventually. What am I missing?
Thank you