¡@

Home 

2014/10/16 ¤W¤È 12:10:39

jquery Programming Glossary: xhr_get

jQuery.ajax handling continue responses: “success:” vs “.done”?

http://stackoverflow.com/questions/8840257/jquery-ajax-handling-continue-responses-success-vs-done

that will run whether the request succeeds or fails. done will only be triggered on success. For example function xhr_get url return .ajax url url type 'get' dataType 'json' beforeSend showLoadingImgFn .always function remove loading image maybe.. 'json' beforeSend showLoadingImgFn .always function remove loading image maybe .fail function handle request failures xhr_get ' index' .done function data do stuff with index data xhr_get ' id' .done function data do stuff with id data An important.. image maybe .fail function handle request failures xhr_get ' index' .done function data do stuff with index data xhr_get ' id' .done function data do stuff with id data An important benefit of this in terms of maintainability is that you've..