¡@

Home 

2014/10/16 ¤W¤È 12:04:29

jquery Programming Glossary: istimeout

jQuery Ajax, overwrite onreadystatechange handler

http://stackoverflow.com/questions/3309185/jquery-ajax-overwrite-onreadystatechange-handler

if you dont mind patching jquery you could add these lines The readystate 2 else if requestDone xhr xhr.readyState 2 isTimeout 'timeout' s.state2 s.state2.call s.context data status xhr The readystate 3 else if requestDone xhr xhr.readyState 3 isTimeout.. 'timeout' s.state2 s.state2.call s.context data status xhr The readystate 3 else if requestDone xhr xhr.readyState 3 isTimeout 'timeout' s.state3 s.state3.call s.context data status xhr before this line jQuery v 1.4.4 or just search for the readyState.. The transfer is complete and the data is available or the request timed out else if requestDone xhr xhr.readyState 4 isTimeout timeout now you can use the .ajax again and put a handler up for state2 and state3 like so .ajax url 'http www.stackoverflow.com'..

How can I change handleError?

http://stackoverflow.com/questions/7866199/how-can-i-change-handleerror

var xml if s.global jQuery.event.trigger ajaxSend xml s Wait for a response to come back var uploadCallback function isTimeout var io document.getElementById frameId try if io.contentWindow xml.responseText io.contentWindow.document.body io.contentWindow.document.body.innerHTML.. io.contentDocument.document catch e jQuery.handleError s xml null e if xml isTimeout timeout requestDone true var status try status isTimeout timeout success error Make sure that the request was successful.. catch e jQuery.handleError s xml null e if xml isTimeout timeout requestDone true var status try status isTimeout timeout success error Make sure that the request was successful or notmodified if status error process the data runs..