我想在 ajax 调用中重新绑定窗口滚动事件
$(window).scroll(function(){
column_height = $("#first_column").height();
screenTop = $(window).scrollTop();
window_height = $(window).height();
if((screenTop+window_height)>=column_height){
$(window).unbind('scroll');
$.ajax({
url: "/service/article_json.php",
type: 'GET',
async: false,
cache: false,
timeout: 30000,
error: function(){
return true;
},
success: function(data){
$.each($.parseJSON(data), function(key,item) {
//Add content to #first_column
$(window).bind('scroll');
});
}
});
}
});
$(window).bind('scroll');
似乎不起作用。