3
I am a beginner programmer in both PHP and Javascript and I have a doubt in a project I am developing.
I have a server connected to a PHP file and am requesting the following fields
$FLD="idfca, solfca";
I created a function within Javascript to load my records, from 10 to 10, with 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 javascript function, instead of the counter.
Friend, use the technology
Ajax
to get the data from PHP. And, in PHP, you answer this data asJSON
. Just use the json_encode function :)– Wallace Maxters
@Ajax wallacemaxters is more for technique not?
– durtto
@durtto I know there, I’m confused until today, but I asked about it here.
– Wallace Maxters
http://answall.com/questions/116153/ajax-n%C3%A3o-%C3%A9-a-program-language%C3%A7%C3%A3o-ent%C3%A3o-o-que-%C3%A9
– Wallace Maxters