当用户到达页面末尾以加载新内容时,如何调用JavaScript(AJAX)功能? [英] How do you call a JavaScript (AJAX) function when the user reaches the end of a page to load new content?

查看:152
本文介绍了当用户到达页面末尾以加载新内容时,如何调用JavaScript(AJAX)功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在twitter(新Twitter)和Facebook上,他们现在可以在页面底部加载新的推文和帖子。



是否有一个JavaScript / jQuery事件,你可以调用/添加到div,所以当浏览器到底部它做一些ajax调用来获取新的数据?



谢谢

Daniel

解决方案

有一个jQuery插件:无限滚动jQuery插件



这里是它实现的模式的描述:交互设计模式


On twitter (new twitter) and facebook they now have the the ability to load new tweets and posts when you hit the bottom of the page..

Is there a JavaScript / jQuery event that you can call / add to a div so when the browser hits the bottom it does some ajax call to get the new data?

Thanks

Daniel

解决方案

There's a jQuery plugin for that: Infinite Scroll jQuery Plugin.

And here's the description of the pattern that it implements: The Interaction Design Pattern.

这篇关于当用户到达页面末尾以加载新内容时,如何调用JavaScript(AJAX)功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆