有一个网站有某种数据。网站通过来自您网页的Ajax请求发送此数据。所谓的连续加载页面。我可以使用php登录这个网站。但我无法从php下载这些额外的页面。如何将ajax代码转换为php
$(window).scroll(function() {
scroll = $(document).scrollTop() + window_height;
if (scroll > 1500){
button.fadeIn();
} else {
button.fadeOut();
}
if(!is_load || !brend) return false;
document_height = $(document).height();
if(document_height - scroll < 1000 && document_height != document_height_prev){
p = p + 1;
document_height_prev = document_height;
var data_send = {
mode: 'json',
brend: brend,
p: p
};
$.ajax({
url: '/catalog/getObjectsListBrend/',
data: data_send,
type: 'post',
dataType: 'html',
success: function(data) {
if(data.length < 100){
is_load = false;
}else{
$('div.tovars ul').append(data);
}
}
});
}
});
什么是目前的代码问题似乎是好的,但'postfields'一部分。 '$ postdata'应该使用['http_build_query'](http://ee1.php.net/http_build_query)来处理。目前的问题是什么? – Eugene