File structure / architecture for AJAX site?

I am building a site using ajax and trying to decide where to put files that provide data for ajax requests.

For example, I will have a .js file that can be included in a page that will create country / state selection fields. I will have a .js file in / inc / js.

However, I am not sure where I want to put the ajax file, which supplies status data based on the selected country. I could put it next to the file that it supports, make a folder for ajax data request files, etc.

What do you do to save your ajax requests organized by a file?

+3
source share
2 answers

Model-View-Controller, ajax, .

:

/application
    /default
        /controllers
            index.php
            index.ajax.php
       /views
         index.tpl
         index.ajax.tpl
    /admin

​​, , ajax ajax .

+2

( ), REST . AJAX, -.

0
source

Source: https://habr.com/ru/post/1698904/


All Articles