Modx incorrectly displays the plug-in file, why?

Try to connect the file in the code which addresses of stores and menus. Doing it this way:
  1. Create a file on the server ID and extension .php (file.php)
  2. Plug it in the head design
    <script type="text/javascript">
    $(document).ready(function() {
    $("#file").load("/file.php");
    });
    </script>

  3. Bring on the empty page, the block with ID<div id="file"></div>
  4. The connection is successful the code in an empty block as I need the items on our website


But since it modx and mapping built by means of a snippet with parameters, they are displayed like this joxi.ru/MAjya54s4aNzq2 this should have some other extension file, ask to have it transferred to a normal appearance joxi.ru/eAOXoOQUxZgQQr? Please tell me that you can try to do? Can connect as something else?
June 3rd 19 at 19:29
1 answer
June 3rd 19 at 19:31
You need to create and fix existing elements of ModX, in terms of elements such as templates, snippets and chunks, as not to reinvent the wheel, pulling the result of executing php files that do not belong to the architecture of ModX.
For this you need to fully understand the purpose of these types of entities, and how from one cause to another.
To understand what and under what conditions the outputs file.php and put the logic in these entities.
Do I understand correctly? I have to create a separate chunk in there calling the snippet with the result of the execution. And already it plugged in head to output instead file.php - Brant_Prohaska commented on June 3rd 19 at 19:34
Snippets - these are elements of logic, written in php. You can call them out as chunks and templates. All elements of the ehpm, as a rule, work out the logic on the server side, generate html fragments for the entire page. The result of server-side logic, what should be on the page after the download polychaetsa in certain tags pages using chunks and snippets, you don't have the head tag. After the page has loaded, you need to provide logic via js client side logic. CMS then only responds to js requests by means of ajax, until a transition to another page. - jerrold_Hickle commented on June 3rd 19 at 19:37

Find more questions by tags AJAXMODX