我在我的视图的<body>
中有以下代码,但是如何从loadmore.php
加载动态数据呢?我还希望它不会循环并停在页面底部?
<script type="text/javascript">
$(window).scroll(function()
{
if($(window).scrollTop() == $(document).height() - $(window).height())
{
$('div#loadmoreajaxloader').show();
$.ajax({
url: "loadmore.php",
success: function(html)
{
if(html)
{
$("#postswrapper").append(html);
$('div#loadmoreajaxloader').hide();
}else
{
$('div#loadmoreajaxloader').html('<center>No more posts to show.</center>');
}
}
});
}
});
</script>
我的loadmore.php代码:
<html>
<body>
<div class="container">
<div class="row">
<div class="col-lg-12 bg-success">
<h4><strong>My Title |</strong><small> my mini title</small></h4>
<h5>
{{$user->name}}
{{$user->username}}
{{$user->description}}
</h5>
</div>
</div>
</div>
</body>
</html>