Wednesday, 7 August 2013

Handling AJAX Requests from multiple scripts

Handling AJAX Requests from multiple scripts

I am involved in a project which requires me to have multiple pages that
will make AJAX calls to update forms. Each page will make different,
specific AJAX calls to another script that will query our database, and
then return various responses, depending on the nature of the data
requested.
So my question is, would I be better off having just one file to handle
ALL AJAX requests? Or is it more appropriate to have a separate file per
script that handles the AJAX request?
Basically, it's the difference between having one large file to handle all
AJAX requests, or creating multiple files to support all my php scripts
that make AJAX calls. I'm not certain which will be more maintainable in
the long run, or if it will even make a difference which choice I make.

No comments:

Post a Comment