Move success callback into AJAX function definition.