jQuery:? Come abilitare timeout
per $.ajax({dataType:'jsonp'...
C'è qualche soluzione http://jsfiddle.net/laukstein/2wcpU/4
$.ajax({
type:"GET",
url:'http://lab.laukstein.com/ajax-seo/.json',
dataType:'jsonp',
timeout:200, // Not working with dataType:'jsonp'
success:function(data){$('#content').html(data.content);},
error:function(request,status,error){$('#content').html('request failed');}
});
non mi piace usare alcuni plugin per questo, come http://code.google.com/p/jquery-jsonp
Duplicate: http://stackoverflow.com/questions/1002367/jquery- ajax-jsonp-ignores-a-timeout-and-doesnt-fire-the-error-event –
Non vorrei usare alcuni plugin per questo, come http://code.google.com/p/jquery-jsonp/ – Binyamin
Forse potresti dare un'occhiata al codice del plugin e vedere cosa fa, come mai la risposta che ho collegato afferma che si tratta di una limitazione di JSONP. –