Search code examples
javascriptajaxreturn

Difference between Ajax return Response function and only return


What is the difference between having the following in an ajax request / call (is it request or call?)

return $output;

and

return Response($output);

both work, but Response does not give me information about the returned element while return only does give me information.


Solution

  • AJAX is a call actually but as we are requesting to server for send us response against some query that's why we call it AJAX request.

    I'm not so sure but Reponse($output) in PHP yields you the modified response from server, by modified response I mean the filtered information to your request and response($output) gives the whole body of response coming from Back end.