I'm novice with Ajax syntax. So I create my load content with append but, I want to know if its possible with PHP? Say to ajax "Learn this php file to display data" and on my PHP file we find a while or foreach with the data of my json file.
I want to use it in PHP because I use this template in some file (this "append") was normally call in 10 files, so i don't want to copy and paste all code, I need to change something, I want to edit only one file.
This is my actually ajax file:
$.ajax(
{
url: 'http://localhost/concerts/json/getConcerts?date=previous&limit=10&offset=' + i++ + '',
type: "get",
dataType: 'json',
success: function (data) {
$.each(data, function (idx, elem) {
$('#concertHome').append('<div>'+elem.bID9+'</div>')});
},
error: function () {
alert('Erreur lors de la requête...');
}
});}