javascript - Ajax.beginform callback properties , can not understand the differences -



javascript - Ajax.beginform callback properties , can not understand the differences -

i read online document describes ajax.beginform callback properties , follow:-

onbegin (in jquert beforesend):- called prior request beingness sent oncomplete (in jquery complete):- called if request successful onfailure (in jquery error):- called if request fails onsuccess (in jquery success):- called when request has completed, irrespective of whether request succeeded or failed

now can not understand meant "called when request has completed, irrespective of whether request succeeded or failed". allow take next examples:-

now if returning http 401 error application , 1 script called , assume onfailure ?, or since returning result onsuccess called instead?

and if un-handeled exception raised , assume onfailure called, oncomplete fire ?

thanks

there succession of 3 callbacks, assuming server sends response (404, 500, 200, 302, etc.). onbegin callback first called. request gets sent , server sends acknowledgement. if request successful, onsuccess gets called; if not, onfailure gets called. after either 1 of onsuccess or onfailure finishes executing, oncomplete callback called.

you can "visualize" way:

|--success -> onsuccess() -->| onbegin--> >--> oncomplete |--error -> onfailure() -->| ------------time line-------------------------->

of course, success/error status needs client first.

javascript jquery ajax asp.net-mvc ajax.beginform

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -