I'm a beginner programmer both in PHP and Javascript and I'm having a question about a project I'm developing.
I have a server connected to a PHP file and I'm requesting the following fields
$FLD="idfca, solfca";
I created a function inside Javascript to load my records, 10 out of 10, with the scroll:
var contador = 1;
$(document).ready(function () {
carregar();
$(this).on('scroll', function () {
if ($(window).scrollTop() + $(window).height() >= $(this).height()) {
carregar();
}
});
});
function carregar() {
for (var i = 0; i < 10; i++) {
$("#lista").append('<li><img src="http://placehold.it/100x100"/><div><h4>' + contador + ' Item</h4><p>Descrição do item '+contador+'</p></div></li>');
contador++;
}
}
What I want to know is how to use the fields I'm pulling from the bank inside this function in javascript instead of the counter.