Consider the following code:
$form['actions']['submit']['#ajax'] = array( 'wrapper' => 'apple-node-form', 'callback' => 'node_add_callback', 'method' => 'replace', 'effect' => 'fade' );
'effect' => 'myCustomAnimation'.
.ajaxComplete() on the
document and have a series of switch statements in there that figure out what to do with the response. But that's a bit hacky, and the switch statements (as well as the initial response parsing) would be additional logic. If I can just define right there in the
$form array PHP code the JS function to be used, no ugly switch statement would be necessary.