The success, target, and update-targets features of the ajax function decide what needs to be done with a response from an ajax request. The update-targets feature, in particular, in addition to conveying the semantics of what it does much better than the one-liner it injects, it also arranges for the response to be provided as a JSON object.
However, success and the target/update-targets features are currently mutually exclusive.
This PR proposes to allow both features to be used together.
I have decided to run success first, if specified, so in an extreme case one can also return in it and skip the target/update-targets part.
If this PR is accepted, I am willing to update the corresponding docs.
Many thanks! Please note that the wiki documentation is generated from https://github.com/mario-goulart/awful-doc. If you want to update the documentation, please send patches to that repo.
The
success
,target
, andupdate-targets
features of theajax
function decide what needs to be done with a response from an ajax request. Theupdate-targets
feature, in particular, in addition to conveying the semantics of what it does much better than the one-liner it injects, it also arranges for the response to be provided as a JSON object.However,
success
and thetarget
/update-targets
features are currently mutually exclusive.This PR proposes to allow both features to be used together.
I have decided to run
success
first, if specified, so in an extreme case one can alsoreturn
in it and skip thetarget
/update-targets
part.If this PR is accepted, I am willing to update the corresponding docs.