In real time, data from another site is loaded via the API using php code. There is a html page on which this data should be displayed when clicking on the "Display data" button. And then the question arises, is it possible to call this Ajax code with a request or can it be somehow done through MVC, by calling a function or something else?
- It does not interfere. - sercxjo
- Even not so @Bim Bam confuses warm with soft. These are MVC and AJAX - 2 different concepts. AJAX ("Asynchronous Javascript And Xml") is an asynchronous data loading technology. And MVC is a pattern for separating data from its presentation. As for the question, then if you want to display data without reloading the page, then ajax is a suitable option. And if it is permissible with a reboot, then you can simply receive data from the accumulating POST page with a request, for example. - ArtResh
- @ArtResh so what about a file with an Ajax request? In models? - Bim Bam
- oneIf you follow MVC, then the script that executes ajax should be placed on the View page. And he should apply for data to the controller, which will already determine from which source he will receive data - ArtResh
|