Is there a way to do a series of jQuery AJAX calls?
When submitting a web form, I would like to validate the server-side files listed in the form data (check their formats, essentially, through a set of RESTful scripts running on the server).
I might have two file pathnames, but I could have more.
How do I chain a series of validation AJAX calls, so that, if any one request 开发者_如何学Cfails with a non-200 status, the entire chain fails and I (for example) redirect to an informative error page?
In SGE, there is a hold (-hold_jid
) option that allows a "master" job to succeed or fail based on whether all children jobs complete or fail. I'm wondering if something similar is possible in jQuery, and if there are examples to get me up to speed quickly?
If you can use jQuery 1.5, check out the new deffered functionality. That will allow you to sequence Ajax calls in a pretty elegant manner.
精彩评论