¡@

Home 

2014/10/16 ¤W¤È 12:07:06

jquery Programming Glossary: requestdone

jQuery Ajax, overwrite onreadystatechange handler

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

to patch jquery for this however 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 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.state3 s.state3.call s.context data status xhr before this line jQuery v 1.4.4.. for the readyState 4 in the source 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..

How can I change handleError?

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

'jUploadForm' id Watch for a new set of requests if s.global jQuery.active jQuery.event.trigger ajaxStart var requestDone false Create the request object var xml if s.global jQuery.event.trigger ajaxSend xml s Wait for a response to come back.. 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 or notmodified if.. 100 xml null Timeout checker if s.timeout 0 setTimeout function Check to see if the request is still happening if requestDone uploadCallback timeout s.timeout try var form jQuery '#' formId jQuery form .attr 'action' s.url jQuery form .attr 'method'..